<FromGitter>
<Daniel-Worrall> I would provide code for the API but it requires authentication
<FromGitter>
<Daniel-Worrall> oh
<FromGitter>
<asterite> What was it?
<FromGitter>
<Daniel-Worrall> and so the response was not getting decoded
<FromGitter>
<Daniel-Worrall> If I remove the header, it is added itself
<FromGitter>
<Daniel-Worrall> I would consider that a bug though
<FromGitter>
<asterite> Ah, yes, I was going to mention that, http client handles all of that transparently. And I think it's documented in the class (not sure)
<FromGitter>
<Daniel-Worrall> it is documented
<FromGitter>
<Daniel-Worrall> It's an odd behaviour though
<FromGitter>
<asterite> Right, it doesn't say what happens when you do add the content encoding. I guess it doesn't decompress automatically and you have to do it
wontruefree has quit [Quit: bye]
<FromGitter>
<Daniel-Worrall> now to check the source and see how I'm supposed to decompress it
<FromGitter>
<Daniel-Worrall> but that helps my understanding.
<FromGitter>
<Daniel-Worrall> I thought I was just requesting plaintext when I withheld the header
<FromGitter>
<asterite> You are not supposed to decompress it, http client does it for you
<FromGitter>
<Daniel-Worrall> yeah, that's fine. I'm just curious of the source code
<FromGitter>
<fgimian> Guys, is there a way to set the indent level when using `to_json` ?
<FromGitter>
<bew> iirc there is `to_pretty_json` where you can configure the indent
<FromGitter>
<fgimian> thanks, let me check it out
<FromGitter>
<fgimian> perfect, that's exactly what I needed
<FromGitter>
<bew> yw ;)
<FromGitter>
<fgimian> 😄
<FromGitter>
<fgimian> Man I'm really loving Ameba
<FromGitter>
<fgimian> @S-YOU btw not sure if you saw my message earlier, but just wanted to thank you for your help with MD5, Brew opennssl is as fast if not faster than `md5sum` 😄
_whitelogger has joined #crystal-lang
<FromGitter>
<S-YOU> I saw that, yw :)
<FromGitter>
<S-YOU> apple make it 5x slower xD
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
<FromGitter>
<fgimian> Has anyone by chance configured the BracketHighlighter extension for Sublime Text to work with Crystal?
<FromGitter>
<fgimian> this is what it does
<FromGitter>
<fgimian> the Ruby regexes work for the most part with Crystal until you start adding macros
<crystal-gh>
[crystal] ysbaddaden pushed 1 new commit to master: https://git.io/f4SwK
<crystal-gh>
crystal/master e4a01b5 Fotis Gimian: Corrected missing return value in the FileInfo flags method
<FromGitter>
<vladfaust> Oh, Sublime user here! I think that Crystal support of Sublime Text 3 is dead, you should migrate to VS Code (even if you have Mi Air 12.5 with 4 GB which starts to lag because of Electron on Linux)
<FromGitter>
<fgimian> @bararchy Have you adapted well with VS Code?
<FromGitter>
<bararchy> I use @faustinoaq config file, then changed a few things + scry etc..
<FromGitter>
<fgimian> kewl! 😄
<FromGitter>
<Daniel-Worrall> I've been using RubyMine with Crystal syntaxer. Still quite broken but there's a lot I love about it
<FromGitter>
<fgimian> never even considered that option 😄
<FromGitter>
<Daniel-Worrall> I'm wanting to contribute to it so that I can use Goto's and code inspections
<FromGitter>
<Daniel-Worrall> But that involves a lot of work with lexing
<FromGitter>
<fgimian> yeah huge job
<FromGitter>
<fgimian> but they have Kotlin and I guess unless the language becomes mainstream, it won't justify the amount of effort required
<FromGitter>
<fgimian> 😄
<FromGitter>
<Daniel-Worrall> If someone builds a good plugin for rubymine, it'd be a lot of the work done for them
<FromGitter>
<shobhitic> How do you get syntax highlighting for `.ecr` files in Sublime Text 3?
<FromGitter>
<fgimian> Hmm, I haven't actually edited an ECR file since starting with Crystal
<FromGitter>
<shobhitic> Y'all just use it for APIs?
<FromGitter>
<fgimian> I'm personally using it for a Mac automation system which I'm re-developing in Crystal
<FromGitter>
<fgimian> Just using Crystal for fun in my personal time, not for work yet. But I do intend to use it for a small internal API at work.
That_Guy_Anon has joined #crystal-lang
<crystal-gh>
[crystal] kostya opened pull request #6252: Add global annotation Property (master...annotation_property) https://git.io/f4SK1
jfo_test has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 264 seconds]
<FromGitter>
<vladfaust> @shobhitic it often works with `.erb` syntax highlighting
<FromGitter>
<shobhitic> Ahh, nice hack
<FromGitter>
<faustinoaq> @vladfaust @fgimian I'm not a sublime text user 😅 Would you like to be member on sublime-crystal repo?, so you can review new contributions 😉
<FromGitter>
<fgimian> My experience with developing Sublime Text extensions is honestly very limited to be completely honest, so I'll have to pass for now if that's cool. But I'll definitely let you know if time crops up in the near future so I can help out.
<FromGitter>
<faustinoaq> Scry (https://github.com/crystal-lang-tools/scry) is a common server protocol, so all scry features (completion, symbols, rename, diagnostics, etc) should be available across all editors 😅
<FromGitter>
<faustinoaq> @fgimian Oh ok, no problem 👍
<FromGitter>
<faustinoaq> > should be available across all editors ⏎ ⏎ *Once we fix some protocol issues* 😅
<FromGitter>
<fgimian> I can see you have so many projects to look after mate
<FromGitter>
<fgimian> I'm so happy right now, just managed to port my Launchpad builder to Crystal
<FromGitter>
<fgimian> what this does is allow you to specify all your apps in a YAML file and it builds your Mac Launchpad automatically by manipulating the SQLite database
<FromGitter>
<fgimian> I spent a long time writing this in Python and just finished the initial porting to Crystal
<FromGitter>
<j8r> @abdllhygt use a class/struct instead
<lvmbdv>
yeah, there are no "static" (think C) variables for methods, a conscious design choice for OOP
<lvmbdv>
it seems you want Zenity to be a class maybe
<FromGitter>
<j8r> or use constants in the module
<FromGitter>
<abdllhygt> @j8r thanks
<lvmbdv>
yeah but constants are *constant* you can't redefine them afaik
<FromGitter>
<j8r> yes
<FromGitter>
<funny-falcon> LLVM has "count leading zeroes" and "count trailing zeros" instructions. Should Crystal have intrinsics for them? Crystal already have popcount intrinsics.
<FromGitter>
<asterite> If you need them for the standard library, they can probably go into the Intrinsics lib, and eventually, if needed, added to Int
<RX14>
we have Int#popcount
<FromGitter>
<asterite> I'm using sublime text for Crystal and it works really well. Never had an issue with it (maybe because I don't write macros :-P)
<RX14>
i don't see why not add them to int
<FromGitter>
<asterite> OK
<Yxhuvud>
I'd certainly use llvm-clz immediately if they were easily available.
rohitpaulk has joined #crystal-lang
<Yxhuvud>
is it possible to add bindings in a third party lib or do they have to be part of the compiler?
<FromGitter>
<j8r> You can have a shard providing them
<FromGitter>
<funny-falcon> @j8r is shard allowed to extend intrinsics ? which way?
<FromGitter>
<reiswindy> ```code paste, see link```
<FromGitter>
<j8r> @asterite Just a way to know if a generated crystal is valid, sort of. The generator should ideally generate pre formated code, but it may be not valid. could you be clearer about the `require`?
<FromGitter>
<asterite> I think compiler crystal syntax, or formatter. Check the crystal repo
<FromGitter>
<asterite> Check the samples too, there's a sample that shows exactly that
<FromGitter>
<j8r> ok thanks i will check out this
rohitpaulk has joined #crystal-lang
<faustinoaq>
@asterite Oh ok :)
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter>
<asterite> Do you need all that code to show wrong behaviour?
wontruefree has joined #crystal-lang
<FromGitter>
<confact> thanks @reiswindy, i tried to set the namespace on the node before xpath as a test but didn't work. Yours example did though so thanks again :)
<FromGitter>
<mjago> What he said ~ who bothered to look at your code.
<RX14>
i'm struggling to think of somewhere where this isn't good
<FromGitter>
<funny-falcon> @asterite , but it is super contrintuitive . That why we need to always bracketting macrosses in C , and it is very annoying.
<RX14>
pasting an assign or a while shouldnt have brackets, but just expressions should
<FromGitter>
<funny-falcon> I really thought 1<<7 were constant-folded before pasting.
<RX14>
no
<FromGitter>
<funny-falcon> Why?
<RX14>
we dont constant fold
<RX14>
thats for llvm
<RX14>
what if you overrode <<
<FromGitter>
<asterite> Someone should really build mind reading module into crystal. Then everyone will be happy
return0e has quit [Read error: Connection reset by peer]
<FromGitter>
<wontruefree> RX14 thanks! I was parsing ids and I guess the remote service increased there id size
return0e has joined #crystal-lang
<RX14>
do you need to parse IDs?
<RX14>
a common thing to do is just store the id as a string
<FromGitter>
<wontruefree> I am putting into another database that expects strings
<FromGitter>
<wontruefree> I mean that also does not seem nessisary but I think it was the default so it made it in
wontruefree has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter>
<codingconcepts> Hey all, I’ve a general question RE the parallelism branch and the roadmap
<FromGitter>
<codingconcepts> Sorry, I blame the shitting mobile experience for sending that early! It looks as though the last commit to that branch was a year ago, is this being worked on in a different branch?
<oprypin>
codingconcepts, was kinda abandoned, now it's back to planning stage
<FromGitter>
<bararchy> @codingconcepts the last branch is singlemsq, and that hasn't been touched either, @bcardiff is planning on how to tackle this thing
<FromGitter>
<codingconcepts> Brilliant, thanks guys. Glad to hear things are still on-track! I’ll have a look at that video!
<FromGitter>
<codingconcepts> Being a full-time Go dev, the idea of being abstracted away and remaining ignorant of the OS thread multiplexing in Crystal sounds perfect. Keeping parallelism as slick as the language.
That_Guy_Anon has quit [Remote host closed the connection]
That_Guy_Anon has joined #crystal-lang
faustinoaq has joined #crystal-lang
<lvmbdv>
can't wait to have actual parallelism tho
<faustinoaq>
Oh, the new version banner on crystal website looks nice :)
<faustinoaq>
Also the `HTTP:Server` example is updated, yay! :)
thews has quit [Ping timeout: 255 seconds]
That_Guy_Anon has left #crystal-lang ["Leaving"]
<lvmbdv>
what's the difference between BigFloat and BigDecimal, on surface level?
<faustinoaq>
(the cheapest model: Intel Celeron, 2GB RAM, Ubuntu)
<FromGitter>
<sdzyba> regarding macros discussion above: it's weird to see that golang doesn't have macros although it's ok generate code all around the place. crystal does have macros (which I consider to be an advanced version of code generation) but some people tend to hate them. I just don't understand that.
<faustinoaq>
Maybe that's why golang compiles so fast ;)
<FromGitter>
<sdzyba> I meant macros usage in development, not compilation time issues
<faustinoaq>
@sdzyba Macros are like an interpreted language executed at compile time, so if you overuse them, then you can get pretty slow compilation times
<lvmbdv>
crystal macros are *too* good imo, stateful macros are the devil's work
<FromGitter>
<sdzyba> I was just comparing macros to code generation in golang. these are similar in the goals they solve
<faustinoaq>
@sdzyba Oh ok, I don't know much about golang, but your comment seems interesting +1
<FromGitter>
<j8r> They seems less porweful/easy than macro – but I don't know much about them
<FromGitter>
<j8r> Can we have templates that generate templates that generates templates recurisvely in Go like macros?
<FromGitter>
<j8r> The good point with macros is we can build a very clean and powerful abstraction, but this adds complexity for debuging :/
jfo_test has quit [Ping timeout: 256 seconds]
<FromGitter>
<sdzyba> there are no code generation tool in golang. people just use regular templates and generate code similar to how you generate some text information.
<FromGitter>
<sdzyba> and it's absolutely ok to do that in golang, although it's neither a part of the language, nor it's stdlib. ⏎ so it feels a bit ugly to be honest.
<FromGitter>
<sdzyba> and macros are a breath of fresh air
<FromGitter>
<sdzyba> and it's absolutely convinient to have them in Crystal
jfontan0 is now known as jfontan
<FromGitter>
<j8r> Thanks for the explanations @sdzyba 😃
spencer has joined #crystal-lang
<spencer>
I've got a couple of crystal related questions if anyone has a second
<spencer>
1. Would anyone be interested in a code analyzer for automated documentation, possibly performance pain points? I'm trying to come up with a good first crystal project to get my feet wet and thought that might be helpful to some people
<spencer>
2. Anyone know anything about oepnssl errors in crystal?