RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.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
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay is now known as bijan_
bijan_ is now known as bijan_awaaaay
bijan_awaaaay is now known as bijan_
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
rohitpaulk has quit [Ping timeout: 260 seconds]
vivus has joined #crystal-lang
vivus has left #crystal-lang [#crystal-lang]
bijan_awaaaay is now known as bijan_
qard has joined #crystal-lang
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
<FromGitter> <anicholson> 👋 Hi everyone. I'm looking into macros atm, and wondered if it's possible to do quasi-anonymous class definitions?
<FromGitter> <anicholson> not completely anonymous, obviously
<FromGitter> <bew> Yes? A quasi-anonymous class has a name, that's all needed
<FromGitter> <anicholson> @bew so if I wanted to do something like: ⏎ ⏎ ```macro wrapped(path) ⏎ class %x(T) ⏎ ... ⏎ end ⏎ end``` ⏎ ⏎ What should I put for %x? [https://gitter.im/crystal-lang/crystal?at=5a8ce7e035dd17022ed1a374]
<FromGitter> <bew> What does your macro do?
<FromGitter> <anicholson> @bew I'm attempting to implement a union type similar to MLish langs
<FromGitter> <bew> Huh, Crystal already has union types
<FromGitter> <bew> That's even one of the reason Crystal is so great
<FromGitter> <anicholson> so I can do: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8ce940e4ff28713aa6207c]
<FromGitter> <anicholson> @bem I don't think that's possible already?
<FromGitter> <anicholson> as in, I don't think `enum` is that flexible
<FromGitter> <bew> You could have in the struct: `@gender : Gender | String`
<FromGitter> <bew> Problem solved
<FromGitter> <anicholson> I could
<FromGitter> <anicholson> but `String` is not a Gender
<FromGitter> <bew> Don't make it more difficult than this, to me it's overkill
<FromGitter> <anicholson> you may well be right, @bew :) . I'm a bit frustrated by the lack of tagged types from ML-land, as they're so useful in domain modelling
<FromGitter> <bew> You could do this
<FromGitter> <bew> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8ceb4f6f8b4b99469f4809]
<FromGitter> <anicholson> oh I like that
<FromGitter> <anicholson> thanks @bew
<FromGitter> <bew> ;)
faustinoaq has joined #crystal-lang
<FromGitter> <bew> and if you want better performance (e.g: for comparaison) and a behavior more like an enum:
<FromGitter> <bew> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8cec5135dd17022ed1b738]
<FromGitter> <bew> so `Gender::Male.value` is 1
faustinoaq has quit [Ping timeout: 265 seconds]
manjaro43534 has quit [Remote host closed the connection]
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
jnyw has quit [Ping timeout: 256 seconds]
ome has joined #crystal-lang
davic has quit [Quit: ZNC - http://znc.in]
DTZUZO has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e_ has joined #crystal-lang
davic has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Client Quit]
alex`` has joined #crystal-lang
alex`` has quit [Client Quit]
alex`` has joined #crystal-lang
qard has quit [Quit: qard]
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
RX14 has quit [Ping timeout: 260 seconds]
RX14 has joined #crystal-lang
RX14 is now known as Guest70846
flaviodesousa has joined #crystal-lang
Guest70846 is now known as RX14
ome has quit [Quit: Connection closed for inactivity]
DTZUZO has quit [Ping timeout: 276 seconds]
ome has joined #crystal-lang
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Client Quit]
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
bijan_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
maattdd_ has joined #crystal-lang
alex`` has quit [Ping timeout: 256 seconds]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
hightower3 has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
hightower2 has quit [Ping timeout: 276 seconds]
bijan_awaaaay has joined #crystal-lang
alex`` has joined #crystal-lang
bijan_awaaaay is now known as bijan_
bijan_ is now known as bijan_awaaaay
bijan_awaaaay is now known as bijan_
DTZUZO has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
Cyrus has quit [Ping timeout: 255 seconds]
Cyrus has joined #crystal-lang
Cyrus is now known as Guest9258
<FromGitter> <faustinoaq> RX14, I found this: https://github.com/felixrieseberg/windows-build-tools ⏎ ⏎ !{npm build tools}(https://user-images.githubusercontent.com/1426799/36077410-66a1d122-0f1f-11e8-9730-3ca50af1e4e6.gif "npm c++ build tools") ⏎ ⏎ I think would be useful to install built-tools dependencies for crystal on windows . Maybe in the future we can do something similar for crystal-windows-installer 😄
<RX14> You'll need the build tools to compile anything
<RX14> Node is interpreted
<RX14> It doesn't need any build tools
<RX14> Crystal always needs build tools because its compiled
<RX14> Of course we'll have build tools because the compiler would be useless without them
<FromGitter> <faustinoaq> Ok 👍
<RX14> Plus none of this is particularly relevent to the current problems on windows
<RX14> Which is time and effort
<FromGitter> <faustinoaq> RX14, do you know if someone is working on parallelism for crystal?
<RX14> No
<RX14> Nobody is
<RX14> Same answer for the last two years
<FromGitter> <faustinoaq> Well, Manas already did a lot of work on thread branch and crystal itself, maybe they are waiting something in crystal master, maybe windows support and stable api have high priority . There are many red tagged issues as well 😅
<livcd> why not raise some money to hire someone fulltime to at least cover some areas ?
bijan_ is now known as bijan_awaaaay
faustinoaq has joined #crystal-lang
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<hightower3> Hey, I have a hash which I serialize with .to_msgpack. how can I then convert the output of msgpack_unpacker.read into a usable hash? The output of read is Hash(Msgpack::Type, Msgpack::Type). Is there a way to do it without using a mapping() ?
<FromGitter> <j8r> i don't think multi thread is a big issue, look at NodeJS
<hightower3> Actually it works, I just can't call the generic read(), must use read_hash() or simila
<hightower3> similar*
faustinoaq has quit [Quit: IRC client terminated!]
bijan_awaaaay is now known as bijan_
bijan_ is now known as bijan_awaaaay
rohitpaulk has quit [Ping timeout: 256 seconds]
bijan_awaaaay is now known as bijan_
alex`` has quit [Quit: WeeChat 2.0.1]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
alex`` has joined #crystal-lang
yisel has joined #crystal-lang
duane has joined #crystal-lang
<yisel> hola de q se trata el grupo
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
alex`` has quit [Quit: WeeChat 2.0.1]
yisel has quit [Read error: Connection reset by peer]
alex`` has joined #crystal-lang
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
Guest34371 has quit [Quit: WeeChat 1.7.1]
<ikanobori> hablamos de crystal
<ikanobori> pero este no es un canal espanol
<ikanobori> oh he's gone anyways
qard has joined #crystal-lang
Kug3lis has quit [Remote host closed the connection]
qard_ has joined #crystal-lang
foca has quit [Quit: :wq]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<crystal-gh> [crystal] RX14 closed pull request #5730: Refactor signal handlers (master...core-refactor-signal-handlers) https://git.io/vA8M5
foca has joined #crystal-lang
vlad_ has joined #crystal-lang
vlad_ has quit [Client Quit]
qard_ has quit [Quit: qard_]
rohitpaulk has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5a0e21f (master - Refactor signal handlers (#5730)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/344416083
<DeBot> https://github.com/crystal-lang/crystal/pull/5730 (Refactor signal handlers)
Guest9258 is now known as Cyrus
Cyrus has quit [Changing host]
Cyrus has joined #crystal-lang
lacour has joined #crystal-lang
flaviodesousa has quit [Ping timeout: 255 seconds]
moei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <lppedd> Hey guys, looking to try out Crystal. What could I do in a couple if hours? I'm an experienced Java developer looking for a nice a compiled language.
maattdd_ has quit [Ping timeout: 256 seconds]
<FromGitter> <lppedd> Btw, I read about Cobol above. I know and worked a lot with RPG, which is quite similar and I think they are nice languages for their purposes. RPG is amazingly fast
codenoid has joined #crystal-lang
<codenoid> hi
maattdd_ has joined #crystal-lang
maattdd_ has quit [Ping timeout: 256 seconds]
<FromGitter> <lppedd> Which are the important features missing in Crystal as of now?
<FromGitter> <bararchy> Full Windows support, multi-threading.
<FromGitter> <bararchy> those are the burning issue
<FromGitter> <bararchy> apart from that it's just a standard community growth and languge maturity
<FromGitter> <bararchy> which will take time as is normal
<FromGitter> <lppedd> @bararchy yeah I read somewhere above about multi-threading. Could you clarify "full Windows support"?
<RX14> crystal doesn't support compiling for windows right now
<FromGitter> <bararchy> have `crystal build` generate a native windows exe + full stdlib working on windows
<RX14> the only way people use crystal on windows right now is using WSL or VMs
<watzon> Is there a way to debug a macro by printing the generated code?
return0e_ has quit [Remote host closed the connection]
<RX14> {% debug %}
<RX14> at the end of the macro
<FromGitter> <lppedd> I'm looking around for new languages. As a long time (full time since 4 years) Java developer it is becoming a little bit boring. ⏎ I switched to Kotlin but here in Italy you won't jobs for that, especially in finance. ⏎ As I'm also tired of VM languages, I began crawling the web and first thing I tried was Rust, which is like honestly, but the syntax is not really nice on the eye. I value code beauty a lot.
<FromGitter> ... Then I tried Nim, but it's a big no-no for me as it uses a C compiler to produce its outputs. ⏎ Crystal is the only one I found with an awesome syntax and that apparently doesn't require external dependencies. [https://gitter.im/crystal-lang/crystal?at=5a8dcba68f1c77ef3a39cb20]
<RX14> why exactly do you want no external dependencies?
<RX14> just interested
<FromGitter> <lppedd> It's all about plug-and-play. I don't want to spend time over configuring / caring for dependencies. ⏎ Also, businesses share the same opinion, a developer should not spend more time on configuring than on coding. ⏎ I like the Rust + Cargo style, basically everything is managed "inside" the Rust project.
codenoid has quit [Quit: i sleep in my keyboard]
<FromGitter> <paulosuzart> @lppedd same for node.js (specially with typescript where it shines). Everything dead simple inside the project
<FromGitter> <lppedd> This is why every time I try to pick C/C++ in a serious manner I end up giving up. Although I like them
<FromGitter> <paulosuzart> you can achieve pretty much the same behaviour with python using virtualenv and ruby using bundler
<FromGitter> <lppedd> @paulosuzart Exactly, and that's why its becoming mainstream. I'm not a JavaScript guy, but as a web developer a like the integration between front and back-end
<FromGitter> <paulosuzart> the good thing with crystal is that it produces a single executble like Golang, besides a clear syntax like ruby, but with types. I'm also a java guy (2004 to 2016). Now mostly work with typescript and python. wish crystal can continue this great path!
hightower2 has joined #crystal-lang
<FromGitter> <lppedd> I'm not going to move from Java (or better, from the JVM) for Python or Ruby. What I like about Crystal is, like you wrote, the native binary output and the awesome syntax. ⏎ There are a lot of languages out there, but somehow after a bit of fiddling around I always find something I don't approve
<FromGitter> <lppedd> Altough I know that Python is easier on the eye and less verbose. But the JVM optimization is freaking insane
<FromGitter> <paulosuzart> sure think. I would get back to jvm to use Scala only. but Typescript does a dam good job for creating apps for startups and MVPs. zero waste of time and fast deliveries, as crystal will provide as soon it reaches higher versions.
<watzon> Maybe there's an easier way to do this than what I'm trying to do. I want to wrap the `HTTP::Client` methods get, post, patch, head, and delete but after each call I want to be able to capture the result and modify it before it's returned. The only way I've been able to think of to do this is to either manually create each method, which I'd rather not do, or use a macro to generate them based off of `HTTP::Client`'s
<watzon> methods
<watzon> Is there an easier way to do that? Something like a middleware layer or `delegate through` would be nice
<FromGitter> <straight-shoota> watzon, I don't think there is
<FromGitter> <straight-shoota> middleware for `HTTP::Client` has been proposed but nothing going on
<watzon> Crap. Ok then, the next question is what is the easiest way to take a method definition and create a wrapper method for it with the same arguments?
* watzon sent a long message: watzon_2018-02-21_20:03:29.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/YueRgaQqzpLtYihcMPdrxqwE>
* watzon sent a long message: watzon_2018-02-21_20:04:08.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/PCLlWZvKZEYfkHnmRSYNsFir>
<watzon> Interesting, with `Crystal::Macros::Def#args` the `*` operator that signifies that everything following it has to be named, is empty
<watzon> `[path, headers : HTTP::Headers | ::Nil = nil, , form : Hash(String, String) | NamedTuple]`
* watzon sent a long message: watzon_2018-02-21_20:20:28.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/jknAJNkxcQjQOvTxjytROUWj>
<watzon> This is probably way more trouble than it's worth
rohitpaulk has quit [Ping timeout: 240 seconds]
<dom96> lppedd: Nim is a no-no because it uses a C compiler? ... why?
<watzon> Ok simpler solution. Wrap the `HTTP::Client` class and just modify the main `exec` method.
<FromGitter> <bew> watzon, the `*` not displaying is a bug I think, you should report it (live: https://carc.in/#/r/3m9b)
duane has quit [Ping timeout: 256 seconds]
codenoid has joined #crystal-lang
<codenoid> is cr tcp module "ready" for production ?
<codenoid> i send (append) 5 msg to client, and my other tcp just receive 1 message
<codenoid> no
<codenoid> of course
qard_ has joined #crystal-lang
return0e has joined #crystal-lang
alex`` has quit [Ping timeout: 256 seconds]
<FromGitter> <bew> It should be.. what kind of msg are you sending?
<FromGitter> <bew> Do you flush the socket after each msg? (Or at least after all the msgs?)
codenoid has quit [Read error: Connection reset by peer]
maattdd_ has joined #crystal-lang
codenoid has joined #crystal-lang
<codenoid> wat is dis ? `Invalid memory access (signal 11) at address 0x0`, but my bin/crystal is successfully compiled
<FromGitter> <anicholson> @codenoid that is the Crystal equivalent of a NullPointerException :P
bijan_awaaaay has joined #crystal-lang
<codenoid> yeha, but at compile time :p
<FromGitter> <anicholson> 0_o
<FromGitter> <straight-shoota> that's a compiler bug
<codenoid> '-'
maattdd_ has quit [Ping timeout: 260 seconds]
<codenoid> lol, tcp_server sample can't compiled with crystal:master
<codenoid> ups, actually my/crystal:master
rohitpaulk has joined #crystal-lang
faustinoaq has joined #crystal-lang
faustinoaq has quit [Client Quit]
maattdd_ has joined #crystal-lang
<FromGitter> <fridgerator> @codenoid are you running out of memory?
<codenoid> no, just compiler bug, bad code, it hasbeen fixed
<FromGitter> <fridgerator> oh ok
qard_ has quit [Quit: qard_]
maattdd_ has quit [Ping timeout: 268 seconds]
<FromGitter> <faustinoaq> > Nim is a no-no because it uses a C compiler? ... why? ⏎ ⏎ Hi dom96 :) ⏎ ⏎ @lppedd I think Crystal also requires some dependencies, including the linker provided by GCC or Clang 😅 see: https://github.com/crystal-lang/crystal/issues/5291 [https://gitter.im/crystal-lang/crystal?at=5a8df8d6c3c5f8b90dea80ed]
qard has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <faustinoaq> I'm bit sad today. I concluded most jobs I can find in my country are for SQL, PHP, JavaScript, VB, C# and Java, that's all 😟
bijan_awaaaay is now known as bijan_
<codenoid> yeah
<codenoid> and my new job is handling Node JS server :3
<codenoid> F async by default
<FromGitter> <faustinoaq> I'm working with C# and VB for a webpage 😓
<codenoid> omg
ome has joined #crystal-lang
<codenoid> let's pray together for crystal in every company
<FromGitter> <faustinoaq> And using .Net even in the front-end http://ext.net/ 😝
<codenoid> amen
qard has joined #crystal-lang
<FromGitter> <faustinoaq> I have been working 4 days on that webpage and still figthing with it. How I wish to use amber, I would finish that work in one day 😄
<FromGitter> <faustinoaq> > let's pray together for crystal in every company ⏎ ⏎ I think is possible but we would need "enterprise" support for IDEs like Visual Studio or Intellij Idea
<codenoid> yeah, for simple webpage, i prefer to use micro framework, like flask or kemal
<codenoid> simple *web
<FromGitter> <faustinoaq> Well, I have been using amber in some college projects and is pretty nice, amber scaffolding is great, you can get a basic app with database under a minute.
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <chris-baynes> Hi, have just discovered Crystal and am a big fan! Started playing with macros and found an interesting problem... if I declare a method which has a parameter called `def` , how can I use that variable without the compiler complaining about defining a def in def?
maattdd_ has joined #crystal-lang
codenoid has quit [Ping timeout: 256 seconds]
codenoid has joined #crystal-lang
maattdd_ has quit [Ping timeout: 248 seconds]
<FromGitter> <anicholson> That sounds like a syntax error, @chris-baynes
moei has quit [Quit: Leaving...]
<FromGitter> <chris-baynes> well you can define a method to have a parameter, you just can't use it: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8e03ef6f8b4b9946a5d5ce]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
<FromGitter> <faustinoaq> https://twitter.com/KadoBOT/status/965852705704103936 ⏎ ⏎ I hope to implement ^ this on vscode-crystal-lang someday 😄
<FromGitter> <chris-baynes> I wanted to expand the `record` macro with a copy method. Unfortunately there's a record defined in std types.cr (DefWithMetadata) that uses `def` as a parameter name
<FromGitter> <faustinoaq> @chris-baynes I think the use-case of special keywords on parameters is for using external internal names (https://crystal-lang.org/docs/syntax_and_semantics/default_values_named_arguments_splats_tuples_and_overloading.html): ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ https://carc.in/#/r/3mao [https://gitter.im/crystal-lang/crystal?at=5a8e064ea2194eb80d973431]
<FromGitter> <straight-shoota> @chris-baynes `def` can be used as an instance variable or method name, but it won't work as a local variable.