snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh>
[crystal] MakeNowJust opened pull request #4489: Parser: correct accept_with_maybe_begin_end to wrap control expression (master...fix/crystal/to-s-no-postfix-control) https://git.io/vH4BU
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
vegai has joined #crystal-lang
mark_66 has joined #crystal-lang
<FromGitter>
<bararchy> Can I use Channels between processes ?
<FromGitter>
<sdogruyol> Grab the result from the process in a channel?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
<FromGitter>
<bew> You can use a Linux pipe between processes (`IO.pipe`)
<FromGitter>
<bew> You'll have to serialize your data, a pipe only knows about bytes
<FromGitter>
<sdogruyol> why not use something like protobuf?
<FromGitter>
<bew> Yes you can, it's one serialization method!
<FromGitter>
<bew> If you want a channel, you can always have a fiber that just read from the pipe, deserialize, create an object, put it in a channel. Then you can use the other end of the channel to get the passed object where you want
<FromGitter>
<bararchy> Hmmm that's interesting , should I go for protobuff or msgpack ?
<FromGitter>
<akzhan> Btw, docker built https://github.com/docker/libchan for Golang that have other language implementations. It may be ported to Crystal.
<FromGitter>
<sdogruyol> what's that
<FromGitter>
<sdogruyol> serialization protocol?
oprypin has quit [*.net *.split]
statikowsky has quit [*.net *.split]
greenbigfrog has quit [*.net *.split]
go|dfish has quit [*.net *.split]
jokke has quit [*.net *.split]
aemadrid has quit [*.net *.split]
BlaXpirit is now known as oprypin
aemadrid_ is now known as aemadrid
<FromGitter>
<akzhan> libchan declares unified API to IPC. msgpack behind the scene
greenbigfrog has joined #crystal-lang
<FromGitter>
<sdogruyol> oh cool
<FromGitter>
<bew> Should be easy to port
jokke has joined #crystal-lang
go|dfish has joined #crystal-lang
<FromGitter>
<bew> Hmm not sure for the easy-ness, but would be cool for sure
<FromGitter>
<sdogruyol> do you use crystal for production yet?
<FromGitter>
<akzhan> just one microservice in docker (something related to payment api).
<FromGitter>
<akzhan> learning-development-deploy took 7 days.
<FromGitter>
<bararchy> Perf boost ?
<FromGitter>
<akzhan> it’s service from scratch, so no comparison available. It simply works. one restart on service update, no cpu cosumtion/memory leaks at all.
<FromGitter>
<akzhan> Crystal looks for me like pretty alternative to Golang (same placement).
zipR4ND has joined #crystal-lang
rohitpaulk has joined #crystal-lang
statikowsky has joined #crystal-lang
duckqlz has quit [Ping timeout: 260 seconds]
monadicDuck has quit [Ping timeout: 255 seconds]
Qchmqs__ has joined #crystal-lang
Qchmqs__ is now known as Qchmqs
<FromGitter>
<ixti> Hi all! Can sombody confirm successfull build of crystal lang with `llvm 3.9.1`?
<FromGitter>
<ixti> Still can't compile on my machine. And on funtoo bug tracker, they think it most likley crystal's bug (and in fact during crystal compiling it says same)
<FromGitter>
<ixti> @RX14 probably I ran it incorrectly. The thing I am not compiling it myself. I'm installing it from portages
<RX14>
oh well
<FromGitter>
<ixti> So I just tried to run that `bin/crystal -v` from working dir
<RX14>
the package build script will download a version of crystal to bootstrap from
<RX14>
so the problem is that version of crystal
<RX14>
there will be a line `make crystal release=true` or similar
<RX14>
before that line add `make crystal`
<RX14>
and it should work
<RX14>
you'll need to build a non-release compiler and then build a release compiler from that debug gompiler
<RX14>
that's so that the correct llvm version is used when compiling the release compiler
<RX14>
yes it's a mess, a fix is in progress
<FromGitter>
<ixti> @RX14 Thank - will try today
<RX14>
i hope it works
<FromGitter>
<ixti> I hope too. Will try increase swap size too if that won't work :D
<RX14>
no it likely won't work
<RX14>
it's a bug in LLVM 3.5
<RX14>
which crystal packages with it in the downloadable version
<RX14>
so you're not compiling crystal with llvm 3.9 you're using llvm 3.5 which has this bug in release mode
<RX14>
and it just hangs and eats memory slowly
<FromGitter>
<ixti> Oh!. Interesting. Thank you! Gonna try your solution right now in fact :D
<FromGitter>
<ixti> @RX14 Just to clarify for myself. If I'll just compile without `release=1` will it be OK?
<RX14>
yes
<RX14>
but you can compile again with release=1 if you want
<RX14>
like `make crystal` then `make crystal release=true`
<RX14>
i'd recommend it so your compiler isn't too slow
<FromGitter>
<ixti> Got it. Thanks!
splitty__ has joined #crystal-lang
<FromGitter>
<ixti> Oh wow! It worked... I was not able to even finish making cup of tea
<RX14>
yeah compiling crystal shouldn't take more than 5 mins
<FromGitter>
<bew> :sparkles:
<FromGitter>
<ixti> That's awesome! Thank you!
<RX14>
a cached debug compile takes 20-30s
splitty___ has quit [Ping timeout: 272 seconds]
<FromGitter>
<ixti> Gonna now try re-emerge package with `release=true`
<FromGitter>
<bew> I get ` - 1226/1227 .o files were reused` where are thoses files?
<FromGitter>
<bew> nvm I've found them
<FromGitter>
<bew> I don't get it, before I couldn't compile crystal with 5G of RAM, now it uses only 2.7G for a full compilation (without bc/obj reuse, not a release one)
<RX14>
you should be able to compile crystal with 4gb ram
<FromGitter>
<bew> And I was using LLVM 4, so the issue wasn't llvm
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<bew> oh no, I think I'm not talking about the right thing.. sry
<RX14>
compiling all_spec DOES take 5gb ram
<FromGitter>
<bew> yes, that's the specs I wasn't able to complile
<FromGitter>
<bew> and I still can't
<FromGitter>
<bew> It's weird: I get `fork: cannot allocate memory`, followed by `Error opening file 'crystal' with mode 'r': No such file or directory (Errno)` what is he trying to do with `crystal`, and why it can't find it?
<RX14>
darn we are quite a way off compiling the compiler for crystal
<FromGitter>
<crisward> Any progress on updating the binaries to use newer llvm? I've been checking this occasionally - https://github.com/crystal-lang/omnibus-crystal/pull/17 but not sure I understand the hold-up. I'm using the heroku buildpack and it's fairly unusable with --release.
<RX14>
yes i don't understand either
<RX14>
i don't understand why they don't just statically link the whole compiler binary
<RX14>
instead of this half-static half dynamic linking that's going on currently
<RX14>
i'm sure it would reequire some work
<RX14>
but it seems to me that a statically linked compiler is the best bet to solve similar problems for good
<FromGitter>
<bew> @RX14 it fails on `codegen (Crystal)` when doing `./bin/crystal build --stats -o .build/all_spec spec/all_spec.cr` so no, it's not trying to compile the compiler... but the specs
<RX14>
yes
<FromGitter>
<bew> or did I mis-understood your comment?
<RX14>
thats what I said
<RX14>
all_spec needs a lot more ram than the compiler to build
<FromGitter>
<bew> I understand that
<FromGitter>
<bew> but is that `Error opening file 'crystal' with mode 'r': No such file or directory (Errno)` error?
<FromGitter>
<bew> what* is that
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> during codegen crystal phase
<RX14>
no idea
<crystal-gh>
[crystal] spalladino closed pull request #4489: Parser: correct accept_with_maybe_begin_end to wrap control expression (master...fix/crystal/to-s-no-postfix-control) https://git.io/vH4BU
<FromGitter>
<sdogruyol> well, make it work is the first rule :P
<FromGitter>
<sdogruyol> let me see
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<sdogruyol> is cltk using a state machine?
<zipR4ND>
the benchmarks only test the parser (aka ast creation), not the whole execution
<zipR4ND>
yes it does
<FromGitter>
<sdogruyol> i'm curious why it's slow then
<RX14>
using a state machine doesn't magically make it fast if the state transition checks aren't implemented efficiently
<FromGitter>
<sdogruyol> right
<zipR4ND>
sdogruyol: I'm not sure either, I just ported the code from ruby and cleaned up the structure step by step. I think the whole thing can boosted If the algorithms get checked ..
<zipR4ND>
@RX14 exactly
<zipR4ND>
honestly I didn't bother to really understand until now, Error driven development. at least I striped out the parser callback execution for every state transition to do the actual ast resolution at the end and only for state-trees that terminate ..
<zipR4ND>
and I included msg-pack recently to cache finalized parsers
<zipR4ND>
graphql-parser takes 8 seconds to initialize on my machine ...
<zipR4ND>
the only big thing that's missing from graphql atm. is directives
<zipR4ND>
I try to create an API for users to easily define directives and hook them into the execution process, but the whole thing is pretty abstract
<FromGitter>
<akzhan> @ zipR4ND no way to know is previous_def possible. it always throw compile error
<FromGitter>
<bew> a macro method `{% previous_def? %}` would be cool though
<FromGitter>
<bew> well more `{% if previous_def? %}`
<FromGitter>
<akzhan> monkey patcher should know what is behind the defnition or should not call previous_def at all.
Kug3lis has joined #crystal-lang
<zipR4ND>
trying @type.methods.any? atm..
<RX14>
i think txe broke ensure on his windows fork
<FromGitter>
<sdogruyol> txe?
<RX14>
yup he did
<zipR4ND>
If several overloads for a method exist, can I address the one specified by a specific module or smth?
<RX14>
no
<FromGitter>
<fridgerator> does anyone know who runs the crystalshards site?
<FromGitter>
<fridgerator> the .org version is down
<FromGitter>
<sdogruyol> org is from @jwaldrip
<FromGitter>
<akzhan> there is chain of def/previous_def.
<FromGitter>
<fridgerator> ty @sdogruyol
<FromGitter>
<jwaldrip> Looking at it now
<FromGitter>
<sdogruyol> np
<FromGitter>
<fridgerator> thanks @jwaldrip
<FromGitter>
<bew> `previous_def` doesn't work with `fun`s ?
LastWhisper____ has joined #crystal-lang
<zipR4ND>
ok I got it to work with finding the method on @type and reusing it's body
<zipR4ND>
my situation is a bit complicated as I have to hook up into the finished macro to define a method for Fields that get defined on the class via a field :name macro ... because the final method is created only on finished I cannot overload it, so the macro that creates the method has to look it up for itself on the TypeNode and inline its body ...
<FromGitter>
<sdogruyol> that sounds...really complicated
<Kug3lis>
Is it possible to duplicate an object for e.g. I do not want to open another connection to same redis but then duplicated would be awesome
<FromGitter>
<sdogruyol> `dup`?
<FromGitter>
<sdogruyol> in case of redis
<FromGitter>
<sdogruyol> guess you need to use a connection pool
<FromGitter>
<bew> zipR4ND, could you share a minimal use case code?
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crystal-gh>
[crystal] ysbaddaden closed pull request #4487: raise(Exception): Setup callstack on raise only if not already set. (master...setup-callstack-on-raise-only-if-not-already-set) https://git.io/vHliY
fedruantine has quit [Remote host closed the connection]
<RX14>
well looks like I can't compile the compiler for windows yet but i can try and make it emit the correct linker command
<FromGitter>
<bew> zipR4ND and what do you want to happen to the previous def of all_values?
<zipR4ND>
but I my situation I cant, because I need to track the VALUES constant as a distinct variable (in macro context it acts as a variable) in every materialization of this module (aka. classes that include and classes that inherit from the one that included)
<zipR4ND>
In my real situation I'm also calling super from the maunally method-overload ...
<FromGitter>
<bew> it's nice, I love that kind of tricks & challenges x)
snsei has joined #crystal-lang
<zipR4ND>
bew: yeah me too, but it's kind of hard to predict sometimes
<zipR4ND>
I don't know whether the goal should be to invent a consistent and powerfull macro design for crystal or just try to thourougly document and finish/fix what's already possible
<zipR4ND>
I think I prefer the later atm
<zipR4ND>
working on something a little more complex shows me that it's not features I'm missing, but more consistent & predictable behaviour and smarter error messages ...
<zipR4ND>
I´m finding some strange things but like with the problem we discussed here now, it's really hard to reproduce sometimes outside of my complex macro created type hierarchy
<FromGitter>
<bew> hmm not sure, the current macro system is already really powerful, consistency should be improved maybe, and missing features added (ex: methods on ProcLiteral nodes)
Qchmqs has quit [Quit: Konversation terminated!]
<zipR4ND>
bew I think so too. but I'm also dreaming about somthing like the nim macro system :) but stability is the most important thing atm I think ..
<FromGitter>
<bew> Building everything at compile-time (type hierarchy, methods, etc..) wasn't the original goal in asterite mind, he says we should do the most at runtime and only syntax sugar at compile-time..
<FromGitter>
<bew> (macro sugar)
<zipR4ND>
bew: I agree and also try to keep the macro usage low ...
snsei has quit [Remote host closed the connection]
zipR4ND has quit [Ping timeout: 240 seconds]
<FromGitter>
<bew> I can understand his wish, but sometimes, to make perfect macro sugar (like you are trying to do), it can be frustrating, and a complete macro DSL (with good compile-time errors, during dsl development & during user usage) isn't an easy task
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
zipR4ND has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Kug3lis has quit [Ping timeout: 258 seconds]
snsei has quit [Remote host closed the connection]
<FromGitter>
<jwaldrip> its updates lazily. it make take a few loads to populate
<FromGitter>
<jwaldrip> Since its all in memory, it populates in the background after a first request. The old method was slow and would block while all repos were loaded
<FromGitter>
<jwaldrip> Im working on a better distributed caching model
<FromGitter>
<emilebosch_twitter> I was thinking of doing some evengalism for crystal-lang, any of the core contributors interest in talking with me?
<FromGitter>
<fridgerator> yo
<FromGitter>
<fridgerator> I haven't seen any of the core members chatting this morning, you might want to message @mverzilli or @asterite (there are others too)
<FromGitter>
<bararchy> You can also ping @sdogruyol who has crystal weekly
<FromGitter>
<bigDaddyS1oth> Ooh nice. Also it just seems like there's a trend to create JavaScript code without using JavaScript: Elm, Scala.js, ClojureScript, Dart, Haxe seem to becoming a bigger trend.
<FromGitter>
<bigDaddyS1oth> -is more if a deeper discussion, but what allows Crystal to be so concurrent while not taking up so much resources?
<FromGitter>
<straight-shoota> But I don't really get it. Javascript does not get any better just because you're using a different language to write it... and transcompile and transcompile and transcompile...
<FromGitter>
<bararchy> @ysbaddaden Do you have package for Alpine Linux ? normal Linux tar.gz wont work
<FromGitter>
<bew> @bigDaddyS1oth because Crystal uses Fibers, which are simply a coroutines system
pduncan has joined #crystal-lang
alibby has left #crystal-lang [#crystal-lang]
<crystal-gh>
[crystal] RX14 opened pull request #4491: Support windows linker (master...feature/link-win) https://git.io/vHBbm
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter>
<mgarciaisaia> Hi everyone! Just passing by to remind you we're doing the CodeCamp's Q&A session (my) tonight - in 5 hours, do your timezone's math :P
<FromGitter>
<mgarciaisaia> We're tweeting and sharing the stream's URL as soon as we have it - stay tunned
<FromGitter>
<bew> will be 2am ><
Philpax_ has joined #crystal-lang
<FromGitter>
<bigDaddyS1oth> @bew So Fibers break up the code into smaller pieces then use multi-threading to run those smaller pieces all at the same time?
Philpax has quit [Ping timeout: 268 seconds]
<FromGitter>
<bew> currently, fibers doesn't run at the same time, there is no multi-threading involved (but it's being worked on)
snsei has quit [Remote host closed the connection]
<FromGitter>
<bew> A fiber is just some code, when a function involve a system I/O operation (ex: read/write from/to a file, a socket, ...) that could take some time, this fiber is paused (waiting for the file/socket to become writable/readable), and another fiber is started (or resumed if it was already running and has been stopped)
<FromGitter>
<bew> and this goes over and over.... and over...
<FromGitter>
<bew> well not exactly: Fibers are managed by a Scheduler, when a fiber is paused, the scheduler check if another fiber needs to run and run it, if not the scheduler will wait for any I/O operation from all paused fibers, and as soon as an I/O can be used, the fiber who wanted this I/O is resumed..
<FromGitter>
<bew> @bigDaddyS1oth that's the big picture, there are of course other things going on!
<FromGitter>
<bew> at least it's how I understood it, if anyone think I'm wrong, please correct me :)
Philpax__ has joined #crystal-lang
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 260 seconds]
snsei has quit [Ping timeout: 240 seconds]
snsei_ has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
pduncan has quit [Ping timeout: 246 seconds]
sp4rrow has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<sp4rrow>
is there a reason why there is no random_bytes API on Random and SecureRandom