<BlaXpirit>
well, my change would not be exclusive to windows
<unshadow>
I guess that for now Crystal is officaly supported only on Linux, so, you should procced with Linux in mind.
<unshadow>
Let the windows branch contact you, or , import your changes to windows
DerisiveLogic has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 276 seconds]
<jhass>
unshadow: premature optimization? optimize a) if it's obvious and takes you little to no extra time (= no research needed) b) you identify an actual issue ;)
<unshadow>
good rule
unshadow has quit [Quit: leaving]
unshadow has joined #crystal-lang
ponga has joined #crystal-lang
datanoise has joined #crystal-lang
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
datanoise has quit [Ping timeout: 276 seconds]
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sandelius has joined #crystal-lang
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
endou_ has joined #crystal-lang
sandelius has joined #crystal-lang
drizz_ has joined #crystal-lang
mdz_ has joined #crystal-lang
drizz has quit [Ping timeout: 258 seconds]
endou has quit [Read error: Connection reset by peer]
<unshadow>
if you maintain packjages you should read it
<jhass>
oh, they released 4?
<jhass>
nope, still at 3.5
<unshadow>
While aur.archlinux.org is currently still running aurweb 3.5.1, there is a setup of a 4.0.0 release cadidate running under aur4.archlinux.org. AUR package maintainers are supposed to move their packages from aur.archlinux.org to aur4.archlinux.org between June 8th and July 8th. On August 8th, aur4.archlinux.org will become the new official AUR (and will be moved to the aur subdomain).
<jhass>
looks like I'll need a few new git aliases
<unshadow>
hahah
Codcore has joined #crystal-lang
<Codcore>
How to assert method to raise Exception?
<unshadow>
raise Something
<unshadow>
or I didnt got your question
<jhass>
expect_raises macro
<Codcore>
in spec i invoke method with forbidden arguments, and expects it to raise an Exception
<jiriki->
ruby is awesome but its too slow for most useful things
<jiriki->
I mean, for native things
<jhass>
it's actually fast enough for most things IME
<jiriki->
I like D but I don't like its syntax and some things from c++
<unshadow>
I built a Reverse Proxy in Ruby, it takes connections from the client and passes to server while modifying data, rewriting headers, gzipping etc... we managed to hold 20k concurrent users on a 4 cores, 8 GB VM
<unshadow>
Ruby is fine, but Crystal is awsome XD
unshadow has quit [Quit: leaving]
datanoise has quit [Ping timeout: 265 seconds]
bcardiff has quit [Quit: Leaving.]
Excureo has joined #crystal-lang
Locke23rus has joined #crystal-lang
bcardiff has joined #crystal-lang
ismaelga has quit []
Locke23rus has quit [Quit: Leaving]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Locke23rus has joined #crystal-lang
strcmp1 has joined #crystal-lang
mdz_ has joined #crystal-lang
datanoise has joined #crystal-lang
mdz_ has quit [Ping timeout: 264 seconds]
unshadow has joined #crystal-lang
<unshadow>
What is better to use, Fiber.new do , or, spawn do ?
<jhass>
spawn I guess
<unshadow>
Apperently sleep inside a Thread cuses a Crystal meltdown
<unshadow>
>> Thread.new { sleep 0.5 }
<DeBot>
unshadow: in macro 'macro_191509088' /usr/lib/crystal/reference.cr:50, line 32: ================================================================================ - http://carc.in/#/r/1cw
<unshadow>
what does that means "%fiber" whats the % ?
<jhass>
that's a macro variable
<jhass>
will get a guaranteed unique name in the generated code
datanoise has quit [Ping timeout: 250 seconds]
<unshadow>
Oh... I see
<unshadow>
so it creates a new fiber, and adds it to this thing Scheduler.enqueue %fiber
<unshadow>
So the arry I see, is actually the schedualer, which gets a [] of Fiber
<unshadow>
what's the point of {{ yield }} ? why the two {{ ?
shama has joined #crystal-lang
<BlaXpirit>
unshadow, if u haven't read the extremely concise docs, what do u want
<unshadow>
Until now I used Thread.new(server.accept) do |client|, this syntax wont work for spawn, Is there an alternative way to do that ?
<unshadow>
BlaXpirit: just did, I read about macros and saw why this is used like that
<unshadow>
sometimes I happen to ask things becuase they pop into my mind, and then go check them and see the explanations, I know this might be annoying, sorry.
<strcmp1>
unshadow, is it just a syntax thing you care about? otherwise its easy to capture server.accept as a local inside or outside spawn block.
<unshadow>
strcmp1: would doing something like server.accept do |client|; spawn do ..., will produce the same thing (ofcurse without a new thread)
<strcmp1>
i dont understand that syntax, i meant to do: client = server.accept; spawn { client }
<jhass>
{{yield}} in a macro is replaced with the "block" passed to the macro
<unshadow>
jhass: thanks :)
<unshadow>
doing client = server.accept will block other clients trying to connect, this is why (I think) doing server.accept do |client| will continue to accepting others while piping the connected client to the spawn
<strcmp1>
im not sure how it is different from Thread.new(server.accept), since the argument is called before a thread has been spawned?
<unshadow>
well, I may be mistaken, but, I think that Thread.new(server.accept) do |client|, will "pipe" the client to the newly created thread, this way your next client which needs server.accept wont get blocked waiting for server.accept to be released
<strcmp1>
i honestly dont know if that is true or not.
<unshadow>
TBH me nither XD I just know that this is what I used and what worked for me in Ruby
<strcmp1>
ruby or crystal i dont know if it is true :) i guess it might be special cased, but i read it as just a way to pass locals through to a thread.
<strcmp1>
i still see server.accept being called from the main thread/caller thread.
<unshadow>
now doing a server.accept do |client|, will create a new client(socket) without blocking server to accpeting more clients
<unshadow>
maybe this is a special case
<strcmp1>
Thread.new("foo", "bar") { |x,y| } would only make sense to me if x and y ended up being copies of those two strings, so they're thread local.
<unshadow>
strcmp1: using spawn, if I do server.accpet do |client| and send client into spawn works, if I do client = server.accept and then send it into spawn will produce a concurrency hell, why ? becuase all spawns will try and use the same client :) this is what client = server.accept is blocking.
<unshadow>
strcmp1: I get 100 * cannt do client.blabla nil class errors
<strcmp1>
ah i see, so thats also when passing a local is useful :)
<strcmp1>
so, the only real problem is that you can corrupt the local your spawn (or thread) block sees.
<unshadow>
yeha :) but to be specific do |client| produces new client object for each server.accept, while, client = server.accept produces a single object and will send it to spawn
<unshadow>
Though now I get Bad File Descriptor exceptions
<strcmp1>
i think it produces a different client object everytime, it just overwrites whatever the previous thread or spawn block saw.
<zamith>
While working with this lib, I've been getting a lot of "Program terminated abnormally with error code: 11", which I assume is a segfault, or similar, but no stack trace or something like that. Is there a way to get one? How can I get useful info out of this error?
<jhass>
zamith: use crystal build and run it through gdb or valgrind
<jhass>
no idea if --debug's been fixed, but can't do harm to add either
<zamith>
so using a C debugger is the way to go here, nothing specific to Crystal, or that Crystal can do to try and help, before I have to reach to one of those?
<jhass>
maybe it will, but it doesn't right now
<jhass>
lldb should help too if you got that
<datanoise>
zamith: if you are on Mac, you can also check Console.app. it should log your crash dumps
<zamith>
I am, thanks for that
zz_Cidan is now known as Cidan
<unshadow>
I'm getting some wierd runtime errors while using spawn, after reading jhass how to ask questions guide, I created a gist with my former working code, my now not working code, and an explanation of what is not working ;) https://gist.github.com/bararchy/6735bf9e1c59914c929a
<unshadow>
the errors are in runtime
<jhass>
I guess accept closes the FD with the block form
<jhass>
loop do client = server.accept
<unshadow>
Oh.... I see
<unshadow>
I'll try that
<unshadow>
Now, I'm back to getting everything is Nil issues, for exampe inside the spawn I have client.close if client, I get a compile error which says: undefined method 'close' for Nil (did you mean 'clone'?)
aemadrid has joined #crystal-lang
asterite has joined #crystal-lang
<asterite>
unshadow: do `spawn helper_method(arg1, arg2)`
<asterite>
otherwise variables inside the block given to spawn are closured and you will get those errors
<asterite>
BlaXpirit: cool! I'm trying to use it, I get: ImportError: No module named 'pycparser.c_generator'
<asterite>
Ah, mmm... the submodule?
bcardiff has joined #crystal-lang
<asterite>
I don't know python :(
DerisiveLogic has joined #crystal-lang
bcardiff1 has quit [Ping timeout: 272 seconds]
asterite has quit [Quit: Page closed]
<BlaXpirit>
asterite, u probably didn't clone recursive
mdz_ has joined #crystal-lang
<BlaXpirit>
for sure, i have the same symptom when the submodule folder is empty
mdz_ has quit [Ping timeout: 256 seconds]
Locke23rus has joined #crystal-lang
<crystal-gh>
[crystal] datanoise opened pull request #724: reduce the excessive number of newlines (<br/>) and do not display attributes (master...master) http://git.io/vkMrn
bcardiff has quit [Quit: Leaving.]
zipR4ND has joined #crystal-lang
<zipR4ND>
hey all, is invoking a block with a scope also supported for forwarded blocks/lambdas/procs?
datanoise has quit [Quit: leaving]
datanoise has joined #crystal-lang
datanoise has quit [Client Quit]
datanoise has joined #crystal-lang
datanoise has quit [Quit: WeeChat 1.2]
<jhass>
no
<jhass>
I mean you can work around the compile time errors but it doesn't work
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: http://git.io/vkMAg
<crystal-gh>
crystal/master a3bb3f4 Ary Borenszweig: Allow invoking `debug()` inside a macro to see what's being generated.
<crystal-gh>
crystal/master 9a6145c Ary Borenszweig: Browser: don't display attributes, and use code tag for body
<crystal-gh>
[crystal] asterite closed pull request #724: reduce the excessive number of newlines (<br/>) and do not display attributes (master...master) http://git.io/vkMrn