marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
marmotini_ has quit [Ping timeout: 268 seconds]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Read error: Connection reset by peer]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Read error: Connection reset by peer]
marmotini_ has joined #crystal-lang
marmotini has joined #crystal-lang
marmotini_ has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
marmotini has quit [Ping timeout: 252 seconds]
DTZUZO_ has quit [Ping timeout: 246 seconds]
maxpowa has quit [Ping timeout: 268 seconds]
maxpowa has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<Heaven31415> Hi
<FromGitter>
<Aaron-JM> Hey
flaviodesousa has joined #crystal-lang
maxpowa has quit [Ping timeout: 252 seconds]
maxpowa has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter>
<straight-shoota> @roblally_twitter I wouldn't use `before_each` ever, because it's a global handler running before each and every single spec in the suite. Better make it a spec helper and call it explicitly in every spec that needs it.
<FromGitter>
<yxhuvud> The built in spec runner is quite .. limited when you are used to rspec.
<FromGitter>
<straight-shoota> Yes. But I kind of think that's a good thing. It force you to write more expressive specs. You don't need to be aware of some hooks and handlers hidden somewhere else in order to understand what a single spec does.
Raimondii has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
ashirase has joined #crystal-lang
<FromGitter>
<yxhuvud> I agree that rspec is a bit too magical, but I think it would be possible to build something in between of todays extremely minimalistic way and what rspec is.
<FromGitter>
<straight-shoota> Maybe... but I honestly don't feel like I'm missing something.
<FromGitter>
<straight-shoota> And I think I've quite literally written thousands of specs.
DTZUZO_ has joined #crystal-lang
sagax has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
silmanduin has joined #crystal-lang
<silmanduin>
hello
<FromGitter>
<silmanduin> Hello
<z64>
hi
<FromGitter>
<silmanduin> Can someone help me? i still havent figured out how to run a *.ll file generated by crystal
silmanduin has quit [Quit: Page closed]
<FromGitter>
<Prutheus> Hello. I am using Jennifer as ORM. I want to store some database rows (as array: `Array(Search)` where Search is `class Search < Jennifer::Model::Base` in a map: `{status: "200 OK", searches: searches}`. When I do a `.to_json` on that map, i can’t compile my program anymore, it complains about JSON::Builder error …. any idea how to fix that?
<FromGitter>
<Prutheus> why does the json builder not know how to build json from that data class? can i specify that somewhere in the `Search` class?
<FromGitter>
<proyb6> @silmanduin is ll format is from Crystal programming language?
<FromGitter>
<silmanduin> yes it is
<FromGitter>
<silmanduin> but how to link pcre and other libraries ?
<FromGitter>
<silmanduin> ( generated by --emit llvm-ir
<z64>
@silmanduin this is a little naive suggestion maybe, but maybe check out `--cross-compile` instead. it emits *.o, but will show you the linker commands to run with `cc`
<FromGitter>
<silmanduin> oh i see, but my goal is to understand how LLVM works step by step :-)
<z64>
@silmanduin right. crystal uses LLVM bindings; if you are working with .ll files yourself i believe one would use `llc`. see https://llvm.org/docs/CommandGuide/llc.html for the general guide; the first sentence seems to describe the workflow of llvm ir -> llc -> asm -> executable. you would use `gcc` etc to do this last step
marmotini_ has joined #crystal-lang
<FromGitter>
<silmanduin> with either lli or llc, i run into the same problem: lpcre and other libraries are not linked. In both cases ( i get "LLVM ERROR: Program used external function 'pcre_malloc' which could not be resolved!" )
<FromGitter>
<silmanduin> ( llc used with the *.bc file, generated by --emit llvm-bc )
<z64>
not sure sorry - this really isn't the best place for these questions; best to find a resource/forum/documentation specifically for llvm
<FromGitter>
<silmanduin> okay let me redirect my problem : ⏎ ⏎ 1) when i do " crystal build something.cr " , the process above is actually done in 1 go from cr to asm ? ( and uses LLVM right ? ) ⏎ 2) my goal is to do the steps manually , and the answers probably lie somewhere behind the crytal build function , just i know too few about the crystal compiler to find out by myself how it is done.
<FromGitter>
<straight-shoota> @bew why are you mad at me? :)
moei has joined #crystal-lang
<FromGitter>
<bew> Naa, now we just need to update crystal in atom language specifications :p
wontruefree has joined #crystal-lang
<FromGitter>
<bew> Ah "why": because you said that github was using highlightjs and so we needed to update the language specifications there to support new keywords on github, but it turns out it's another project
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 272 seconds]
DTZUZO_ has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<straight-shoota> oh, did I?
<FromGitter>
<straight-shoota> Well, the docs use highlightjs. And many others, too.
<FromGitter>
<bew> Or it was someone with a verhrry similar username?
sagax has joined #crystal-lang
<FromGitter>
<bararchy> @vladfaust @Schniz we use circleCI its much faster then Travis and the overall process makes much more sense + gotta love the "workflow" config
<FromGitter>
<roblally_twitter> @straight-shoota Yeah, I came to the conclusion that it was questionable when I saw the signature. I had originally assumed that it would be Context specific and when it wasn't I dropped it. I am 100% with @yxhuvud though, spec as it stands is probably too limited for my tastes. Repeating the same code over and over masks the wood with too many trees making it harder to spot the essence of what is
<FromGitter>
... being tested, creating boilerplate code that we assume will be the same so we don't read it... but sometimes it isn't, and creating an impediment to refactoring because I have to change so many different places. I appreciate that other people can have different perspectives, but I've been TDDing code since 1999 and, after tryi ... [https://gitter.im/crystal-lang/crystal?at=5bca0dd11c100a4f29b02b7d]
non-aristotelian has joined #crystal-lang
<FromGitter>
<nekocentral> I'm trying to get a timeout set on the http::client.get is that possible?
<FromGitter>
<nekocentral> I tried adding the class to but failed
<z64>
indeed, you can't time out from trying to make a connection if you can't find where to connect to to begin with
<FromGitter>
<Prutheus> Hello. How can I convert an XML::Node to JSON::Any ?
<FromGitter>
<nekocentral> how would i catch and mabye shorten that timeout
<FromGitter>
<nekocentral> as it now takes over 30 seconds
<z64>
@nekocentral are you talking about the call to getaddrinfo?
<FromGitter>
<asterite> @nekocentral dns timeout currently doesn't work in crystal
<FromGitter>
<Heaven31415> Hi
<FromGitter>
<Heaven31415> How can I test a compile time exception in a spec?
<oprypin>
Heaven31415, can't
<FromGitter>
<roblally_twitter> @Heaven31415 I don't think it is possible. But that's something I've always worried about: with a dynamic language I can write tests to ensure that something never happens even when the code changes. With a dynamic language, I can only write tests for the things that are currently possible.
<FromGitter>
<Blacksmoke16> the spec wouldnt run so thats a good indication that something is wrong :p
<FromGitter>
<markrjr> Maybe I'm overthinking this, but how would I convert from an int to an unsigned int?
<FromGitter>
<markrjr> I was going off the GitBook.
<FromGitter>
<Heaven31415> I really feel you, it isn't really documented anywhere
<FromGitter>
<Heaven31415> If you are asking whether `as` is working the same way as `to_u32`, then I think the answer is no.
<FromGitter>
<Heaven31415> `as ` isn't converting anything, it only tells type system to treat something like something else
<FromGitter>
<markrjr> Ohhhhh.
<z64>
yeah if you were referring to https://crystal-lang.org/docs/syntax_and_semantics/as.html - the context of the opening example is important. `a` *can be* Int32 or a String at runtime; `.as(T)` asserts that it will be a certain type, or raise an exception
<FromGitter>
<Blacksmoke16> for if the number is hardcoded of a given type
<FromGitter>
<markrjr> That's really dope.
<FromGitter>
<Blacksmoke16> but obs not for when the val is a variable
rohitpaulk has quit [Ping timeout: 246 seconds]
DTZUZO_ has joined #crystal-lang
DTZUZO_ has quit [Ping timeout: 250 seconds]
<FromGitter>
<Heaven31415> If some object `foo` has instance var `x`. Why is writing something like this okay and what does it mean? `foo.@x` It seems it gives you a direct access to instance vars, without a need to call a method.
<FromGitter>
<vladfaust> Oof, finally deployed it. Check https://crystaljobs.org. Gonna sleep for now, will approve jobs (if any) tomorrow. Sorry if it has bugs, staging went all good.
<FromGitter>
<jwoertink> good work @vladfaust
<FromGitter>
<vladfaust> Thank you :)
<FromGitter>
<Heaven31415> I don't want to discourage you, it's really a nice idea, but isn't it a little too early?
<FromGitter>
<jwoertink> It's never too early for greatness!
marmotini_ has quit [Ping timeout: 252 seconds]
wontruefree has quit [Quit: bye]
marmotini_ has joined #crystal-lang
silmanduin has joined #crystal-lang
<FromGitter>
<girng> hello!!
DTZUZO_ has joined #crystal-lang
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter>
<bajro17> its not early already crystal is so good. I already say this is what we need to make as much more is possible sites around crystal programming language some ecosystem. To more and more people hear about this beautiful project.
silmanduin has quit [Ping timeout: 256 seconds]
<FromGitter>
<dscottboggs_gitlab> I'd rather fix a bug in crystal itself than try to write with my hand tied behind my back in go or bog down my code by writing in ruby or python
<FromGitter>
<girng> ^^^
<FromGitter>
<girng> Only dumb bugs i've ran into was WSL only
<FromGitter>
<girng> That's not crystal's fault though so..
<FromGitter>
<girng> It's a risk i'm willing to take for development, fine w/ me ;-)
<FromGitter>
<bajro17> I want use it for parameters in combination with http params
<FromGitter>
<dscottboggs_gitlab> since kemal already implemented that and I think lucky and amber have something similar, why not see how one of them implemented it?