RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.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
<FromGitter> <asterite> Wow, reading code in another language, I find other languages so unreadable compared to Crystal... so many imports, exports, too many symbols and noise... maybe I'm biased, though
baweaver is now known as lemur
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
lemur is now known as baweaver
<FromGitter> <fridgerator> ^^
<FromGitter> <fridgerator> like Java, with its endless boilerplate
abm has quit [Ping timeout: 268 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wmoxam has joined #crystal-lang
Creatornator has joined #crystal-lang
<FromGitter> <bcardiff> @bararchy tomorrow i tagging day :-)
Raimondii has joined #crystal-lang
<FromGitter> <fridgerator> 👍 💯
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
<FromGitter> <bararchy> @bcardiff 🎉
Harikiri has quit [Remote host closed the connection]
beizhia has joined #crystal-lang
akaiiro has quit [Remote host closed the connection]
flaviodesousa has joined #crystal-lang
<FromGitter> <newtonapple> I'm trying to understand why `Int` & `Number` types work as arguments to methods but not as a property / instance variable declaration types.
<FromGitter> <newtonapple> Here is an example as arguments to methods: https://play.crystal-lang.org/#/r/4p5x
<FromGitter> <newtonapple> Example as property declaration type: https://play.crystal-lang.org/#/r/4p5y
<FromGitter> <newtonapple> Union type works though: https://play.crystal-lang.org/#/r/4p63
<FromGitter> <newtonapple> Basically, I'm trying to see if there is a built-in Number type that I can use for property declaration without declaring an alias union type of a bunch of Ints and Floats myself.
beizhia has quit [Ping timeout: 260 seconds]
abm has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
<FromGitter> <svs> Hello ⏎ Consider the short program below ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5b6c1552988005174eb55700]
<FromGitter> <Flink> @asterite Well in the end I guess what I’m asking for is to be able to do something like `{{ @type.macros }}` or that `{{ @type.methods }}` returns also macros defined for this type. ⏎ @straight-shoota Thanks for your answer, I’ll consider opening a feature request then :slight_smile:
<FromGitter> <straight-shoota> @svs see #4837
<FromGitter> <sclee15> Hello. What ide should i use to use code completion for crystal?
<FromGitter> <bararchy> I would argue that Sublime or "code"
<FromGitter> <j8r> @sclee15 You can use scry (https://github.com/crystal-lang-tools/scry) with Atom/VSCode
<FromGitter> <bararchy> Scry with VSCode is that best
<FromGitter> <bararchy> competabiltiy wise
<FromGitter> <sclee15> Is it usable state?
<FromGitter> <bararchy> Yeha
<FromGitter> <bararchy> i'm using it in prod
<FromGitter> <bararchy> as main IDE for crystal
<FromGitter> <bararchy> same goes to all my team
alex`` has quit [Quit: WeeChat 2.2]
alex`` has joined #crystal-lang
<jokke> is there any way to declare that a method might throw an exception and force handling in the caller unless skipped with an annotation or something? :)
<FromGitter> <straight-shoota> jokke, no
<FromGitter> <straight-shoota> I don't think there are any plans for this
<FromGitter> <straight-shoota> But it's certainly a valuable concept
<FromGitter> <straight-shoota> OTOH, any exception can raise and having checked exceptions might lead people to think only those could be raised.
<FromGitter> <straight-shoota> *any expression
<FromGitter> <asterite> The compiler tracks which calls raise and which don't, so it's definitely possible (though it doesn't currently track which exceptions are raised)
<FromGitter> <shayneoneill> Nub questison here. I'm writing bit of a singleton (I know... I know.. ) And I have a method thats like this;- ⏎ ```def self.instance ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b6c3f57988005174eb65d0f]
<FromGitter> <shayneoneill> Urg. Dont know what that doesnt \n for code
<FromGitter> <straight-shoota> You've got to put the code between triple backticks ` ``` `
<z64> @shayneoneill assign it to a local var first; `instance = @foo_instance ||= new; return instance`
<FromGitter> <cfsamson> Hi. Does anyone know how to see in the source code what LLVM version release 0.26 is targeting?
<FromGitter> <straight-shoota> depends on which version you have installed...
<FromGitter> <straight-shoota> `crystal version` shows you what the compiler uses
<FromGitter> <cfsamson> Hmm, ok, it says 5.0.2, but when I check which version Rust uses on my Mac its 7.0...
<FromGitter> <cfsamson> Maybe Rust ships with a version of LLVM and Crystal uses an system install?
<FromGitter> <cfsamson> yeah that must be it, clang on my mac is 5.0.2
<FromGitter> <asterite> Depends on your os
<FromGitter> <asterite> Crystal is distributed in different ways depending on the os
<FromGitter> <cfsamson> ok, thanks. I think I (almost) figured this out now
akaiiro has joined #crystal-lang
akaiiro has quit [Remote host closed the connection]
akaiiro has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
akaiiro has quit [Ping timeout: 240 seconds]
<FromGitter> <fernandes> hi everyone, a simple question, what's `Pointer(Void)` ? hahah
<FromGitter> <fernandes> using a C binding that a function parameter is `user_data : Void*`
<FromGitter> <straight-shoota> it's a pointer with no datatype
<FromGitter> <straight-shoota> this is commonly used in C to pass references of arbitrary type
<FromGitter> <straight-shoota> see https://www.geeksforgeeks.org/void-pointer-c/ for example
<FromGitter> <fernandes> oh @straight-shoota thanks for the quick reply... let me read ;)
flaviodesousa has quit [Read error: Connection reset by peer]
flaviodesousa has joined #crystal-lang
<FromGitter> <fernandes> @straight-shoota I made some progress, thank you... now I'm dealing on how to port a `const struct StructName * SecondStruct(param)` to the C binding heheh
<FromGitter> <fernandes> this is the real example: ⏎ ⏎ struct GraphQLAstFieldDefinition; ⏎ const struct GraphQLAstName * GraphQLAstFieldDefinition_get_name(const struct GraphQLAstFieldDefinition *node); [https://gitter.im/crystal-lang/crystal?at=5b6c6cc45b07ae730a964d42]
<FromGitter> <fernandes> `crystal_lib` didn't processed this case, now I'm stuck on it
<FromGitter> <decal> Is there a way to develop DNS client programs in crystal? i.e. something that queries with custom types and classes in the protocol header..
akaiiro has joined #crystal-lang
akaiiro has quit [Ping timeout: 244 seconds]
<FromGitter> <bararchy> @bcardiff 🎉 0.26 merged :) can you share the build link?
<FromGitter> <jwoertink> Is `uninitialized TypeThing` still a thing?
<FromGitter> <j8r> The builds are likely not finished yet
<FromGitter> <jwoertink> I'm getting a `undefined method 'uninitialized'` error
akaiiro has joined #crystal-lang
<FromGitter> <bew> @jwoertink how are you using it? It works only in a few cases
<FromGitter> <jwoertink> ```class Thing ⏎ @_x : Whatever = uninitialized Whatever ⏎ ⏎ .... ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5b6c75ec67eb9f60feb9cb7b]
<FromGitter> <jwoertink> something like that
<FromGitter> <jwoertink> I thought I had done that before and it worked, but maybe that was in an older version of crystal and it changed?
<FromGitter> <jwoertink> or I'm just crazy (most likely the case)
<FromGitter> <bew> Try removing the `: Whatever`? (i know it would be weird)
<FromGitter> <jwoertink> ah! that works haha
<FromGitter> <jwoertink> thanks
<FromGitter> <jwoertink> :D
<FromGitter> <bcardiff> @bararchy https://circleci.com/workflow-run/ef62fff9-e2ed-46f1-8865-b6b6a591d25f . it's better to watch something else in the "tv" :-P
<FromGitter> <fernandes> @bcardiff
beizhia has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.2]
akaiiro has quit [Ping timeout: 268 seconds]
<FromGitter> <bararchy> Lol true, just really want to get my hands on 0.26 goodness
<FromGitter> <asterite> what specifically from 0.26.0?
Creatornator has joined #crystal-lang
francisl has joined #crystal-lang
<FromGitter> <bararchy> @asterite HTTP server bind on unix sockets
<FromGitter> <asterite> Oh, that's good :-)
<FromGitter> <asterite> I like how the community improved the standard library so much, and I hope it gets better and better until 1.0 (like, there are many unix-ish names copied from Ruby where a less archaic name would be better, like Dir.glob)
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
<FromGitter> <straight-shoota> `glob` isn't even that bad...
DTZUZU has quit [Quit: WeeChat 1.9]
<FromGitter> <bcardiff> CircleCI is complaining ⏎ ⏎ > Server is overloaded, please try later ⏎ are you all watching the build process? [https://gitter.im/crystal-lang/crystal?at=5b6c887ea3a93d242241645a]
<FromGitter> <bararchy> lol
<FromGitter> <bararchy> They should use Crystal and avoid runtime null errors hahahah
notdaniel has quit [Quit: The Lounge - https://thelounge.github.io]
<FromGitter> <fridgerator> lolol
notdaniel has joined #crystal-lang
<FromGitter> <bararchy> @bcardiff seems build ended
<FromGitter> <bararchy> when will signed binaries be avilable?
beizhia has quit [Remote host closed the connection]
francisl has quit [Quit: francisl]
<FromGitter> <bcardiff> during today or early tomorrow should be. it's already in the signing queue :-) after some smoke tests. unsigned packages and binaries are available in the dist_artifacts' Artifacts tab as usual.
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
return0e_ has joined #crystal-lang
DTZUZU has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
francisl has joined #crystal-lang
<FromGitter> <bararchy> OMG did @ysbaddaden just made a multi-threaded event loop .... Damn nice!!!
<FromGitter> <asterite> where?
<FromGitter> <bararchy> ^ this link
<FromGitter> <bew> Wow @ysbaddaden awesome
Jenz has joined #crystal-lang
<FromGitter> <bew> Written in C11, 'd love to read that
<Jenz> I think Macros::CharLiteral should have a #ord method
<Jenz> And Macros::NumberLiteral a #chr method
<Jenz> Any core-team people here with opinions?
<Jenz> If not, I'll just go ahead and (attempt to) create a PR
<FromGitter> <bew> You can simply do `{{'c'}}.ord`
akaiiro has joined #crystal-lang
<Jenz> Indeed, but not e.g. HELLO{{'c'.ord}}
<Jenz> Which, if charliteral had an #ord method, would evaluate to HELLO99
<FromGitter> <bew> Ah, true.. This usecase looks a bit weird to me, why do you do that?
<Jenz> Wait a sec
<Jenz> I've found this, to simply be: impossible with macros
<FromGitter> <straight-shoota> It shouldn't be to difficult to add
<Jenz> Which is why I thought I finally might have something to contribute
* Jenz _D
* Jenz s/_/:/
<FromGitter> <bew> was thinking about that: https://carc.in/#/r/4pal but yeah looks like it doesn't work
<Jenz> Exactly same thing I tried (apart for the pps) :)
<Jenz> And now I realized my initial example with HELLO{{'c'.ord}} wouldn't work either way...
<Jenz> Oops
francisl has quit [Quit: francisl]
<oprypin> Jenz, just have two variables in a loop
<oprypin> A and start with 65 and increment both
<Jenz> orypin, I can't get the char in the constant identifier
<Jenz> E.g. LowerA
<Jenz> It would be Lower67
<Jenz> Or whatever A is
<Jenz> 97
a_b_m has joined #crystal-lang
a__b__m has joined #crystal-lang
abm has quit [Ping timeout: 244 seconds]
<oprypin> Jenz, for "ABCD".chars
<oprypin> also lol
a_b_m has quit [Ping timeout: 244 seconds]
<Jenz> oprypin: that doesn't look ideal though, does it?
<oprypin> "z".to_i(36) == 35
<oprypin> it's something lol
<Jenz> haha, indeed
hightower2 has joined #crystal-lang
<hightower2> How do I output log messages under Kemal using Kemal's built-in logger?
Jenz has quit [Quit: Lost terminal]
Creatornator has joined #crystal-lang
Jenz has joined #crystal-lang
* Jenz wonders if the compiler will ever be finished compiling the compiler spec
Jenz has quit [Quit: Lost terminal]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <asterite> Just do for c, i in 'a'.. 'z' and add 65 to i, or something like that
akaiiro has quit [Remote host closed the connection]
akaiiro has joined #crystal-lang
<FromGitter> <bew> You can't do `'a'..'z'` in macros
<FromGitter> <asterite> Bummer
<FromGitter> <bew> But maybe a pr will make it possible :)
<FromGitter> <asterite> We can't keep adding methods like these forever
<FromGitter> <asterite> Ideally macros should be compiled to crystal code or something like like that, or we should have an interpreter...
<FromGitter> <bcardiff> I don't discard doing code generation for some usecase. Like the one used in unicode data. It is problematic if the generated code is target dependant, but if not, and the logic can't be handled in macros, generating some code is good enough IMO.
<FromGitter> <asterite> Otherwise every little thing will require more methods, and for 1.0 it'll be impossible to determine everything that should go in
<FromGitter> <bew> Oh yeah definitely
<FromGitter> <bew> But then should we load and interpret the whole stdlib so it can be used in macros?
Creatornator has joined #crystal-lang
johndescs has quit [Ping timeout: 244 seconds]
johndescs has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter> <Timbus> ooOo CTFE hey
akaiiro has quit [Remote host closed the connection]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang