strcmp1 has quit [Remote host closed the connection]
bombless has joined #crystal-lang
benhuda has joined #crystal-lang
datanoise has quit [Ping timeout: 258 seconds]
BlaXpirit has joined #crystal-lang
sandelius has joined #crystal-lang
Arrrr has joined #crystal-lang
Arrrr has left #crystal-lang ["WeeChat 1.2"]
strcmp1 has joined #crystal-lang
ponga has joined #crystal-lang
apfohl has joined #crystal-lang
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apfohl>
Hello, I've created a blank crystal project with "crystal new example". Is there any special way to compile the project with "crystal build|run" or do I have to run it on the the main file?
sandelius has joined #crystal-lang
<jhass>
apfohl: just the latter
<jhass>
or any file you want as entry point really
<apfohl>
ok, but why is there a crystal project?
mdz_ has joined #crystal-lang
benhuda has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
huh, what do you mean?
<jhass>
why the compiler suggest a certain project structure?
<apfohl>
yep
mdz_ has quit [Ping timeout: 258 seconds]
<apfohl>
i mean it's nice to have all that stuff like .travis.yml auto generated for you, but i would assume that i can make crystal run in the project or at least crystal build and that happens
<apfohl>
or should i use make for that?
<jhass>
well, it's always good to have a community standard, so future tools will likely have something to build upon ;)
<jhass>
crystal build/run defaulting to something like src/$(basename $(pwd)).cr wouldn't be a too bad idea actually
<apfohl>
so, what is the best practice right now?
<jhass>
I think it still has to develop ;)
<apfohl>
ok :)
<jhass>
manastech/crystal uses a Makefile but I'm personally not a too big fan of that and I don't see many projects adopting it
<jhass>
maybe someone does something like rake for crystal sometime...
<strcmp1>
how are you jhass, my favorite deutsch man
<apfohl>
but it's actually the best method to automate it with a makefile i guess.
<jhass>
strcmp1: it's a nice warm & sunny day, could be worse ;)
<strcmp1>
same here 8)
<jhass>
well, I have some hopes somebody gets around to do something like rake for crystal ;)
<apfohl>
but thanks anyway, i'm looking forward to a nice solution :)
<apfohl>
so long and have a nice day :)
<apfohl>
btw. make for crystal would give a nice name -> cake
<BlaXpirit>
unshadow, can't do anything with macros
<unshadow>
Oh... so it's like structs ? (as in I need to implament them in Crystal)
<BlaXpirit>
no, it's not like structs o.o
<BlaXpirit>
let's just say macros are not exported
<unshadow>
.... I meant that it's the same as ""IN"" structs, that you cannot use a C struct from crystal, you need to redo it in Crystal, so the same goes to macros as in you need to redo them in Crystal ?
<unshadow>
I didnt mean that Structs == Macros
<BlaXpirit>
still not the same
<unshadow>
nm... Ok
datanoise has joined #crystal-lang
jhass is now known as DeBot
DeBot is now known as jhass
DeBot has joined #crystal-lang
datanoise has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
benhuda has joined #crystal-lang
<unshadow>
>> Signal.trap(Signal::INT) do { sleep 1}; end
<DeBot>
unshadow: Error in line 7: undefined method 'inspect' for Void - http://carc.in/#/r/27d
<unshadow>
>> Signal.trap(Signal::INT) do ; end
<DeBot>
unshadow: Error in line 7: undefined method 'inspect' for Void - http://carc.in/#/r/27e
<unshadow>
was there and changes to Signal lately ?
<unshadow>
in ./aeon-client.cr:14: undefined method 'trap' for Signal:Class
<jhass>
should be, if you have static versions of everything around
<strcmp1>
if my program doesn't use regular expressions can i exclude libpcre?
<jhass>
perhaps, I never tried
<strcmp1>
likewise, if i don't use some other library, can i just exclude it?
<strcmp1>
ok :)
<unshadow>
I'm trying to build a client for a remote "telnet" like connection, but it seems that I get some wierd issues that the telnet client wont. The issues are text misspresentation, read errors, as in some text just never shows up etc... this is the code https://github.com/bararchy/aeon-client/blob/master/aeon-client.cr
<unshadow>
you can check with the telnet using telnet alteraeon.com 3000
<unshadow>
to see the difference
<asterite>
There was a bug regarding non-blocking IO and read/write, can you check with the latest std?
<asterite>
I'll soon make a release anyway
<strcmp1>
hey asterite, if i don't use regular expressions, can i exclude it libpcre? same applies for the other dyn libs, if i dont use the feature provided, can i avoid linking them?
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: http://git.io/vICuq
<crystal-gh>
crystal/master 82a1d87 Ary Borenszweig: Hide some things from the docs
<unshadow>
asterite: It seems that the issue is still there even on HEAD
<vikaton>
asterite: will C FFI with custom header files become a feature soon?
<BlaXpirit>
vikaton, what is custom header files?
<vikaton>
like importing a C function from windows.h for example
<asterite>
unshadow: `connection.read_nonblock(4096)` -> don't use that
<asterite>
I think we'll eventually remove that method
<asterite>
use connection.read(4096)
<unshadow>
is sock.read non_blocking ?
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asterite>
Yes
<asterite>
IO is non-blocking by default since a couple of versions
<asterite>
so that read_nonblock probably stopped making sense
<asterite>
(but I'm not sure)
<unshadow>
it seems it's "kinda" non blocking, using read_nonblock has a smaller timeout on the read or something ? read waits
<asterite>
read_nonblock sets the LibC::O_NONBLOCK flag, but Socket sets that too by default, so it's kind of redundant
<asterite>
maybe it should work anyway... mmm... does your code work with plain read?
<unshadow>
Using plain read makes it terrible slower, espically when lowering the bytes to like 512, maybe its because of spawn ? the non_block runs much better, thats why I ask
<asterite>
Well, read allocates a new String... maybe you can read to a static array
<asterite>
But I'm not sure what your program does
<asterite>
But non_block gives you incorrect results, so it doesn't matter it's faster. Maybe it's faster because it doesn't do what it's supposed to do :)
<unshadow>
asterite: it buffers live data from a server in a loop and prints it while data keeps coming
<unshadow>
at lest the read part
<asterite>
and what's the data?
<unshadow>
Strings
rpitt has joined #crystal-lang
datanoise has joined #crystal-lang
<unshadow>
you can just take the autoreader method, and pass it connection = TCPSocket.new("alteraeon.com", 3000)
<unshadow>
change read to read_nonblock and you would see what I'm talking about
<asterite>
but you print by chunks of random lengths like 512?
<asterite>
it's ascii data?
<unshadow>
Yeha
<unshadow>
The server sends the data parsed, so the print should just print it as is,
<BlaXpirit>
i actually once tried to find crystal subreddit and thought it didn't exist
<BlaXpirit>
maybe i didn't search well
<asterite>
For now I changed it to the HTTP server... there are like 4 or 5 web frameworks projects for crystal, so people clearly want that :)
<asterite>
Well, 0.7.3 is out. Hope it works in linux :-)
<jhass>
32 bit binary is pushed, building package atm ;)
<jhass>
btw I support that request of shipping -fPIC compatible libraries in the official packages ;P
<asterite>
I know nothing about that :(
<BlaXpirit>
well, i posted a link to crsfml there. better late than never. thumbnail is ridiculous though
<asterite>
unshadow: not sure how that alter aeon server is to be used, maybe you should read by lines with gets... but I'll read about it later, gotta go now
<jhass>
asterite: should be a matter of adding -fPIC to your CFLAGS in the thing you use to build everything
<unshadow>
asterite: You can see very easily using telnet to the same server port that those issues are not happening when using telnet
<unshadow>
not sure why though
asterite has quit [Ping timeout: 246 seconds]
datanoise has quit [Ping timeout: 256 seconds]
<Mercurial_>
Hi, is there a package manager for crystal yet?
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
sandelius has joined #crystal-lang
<Mercurial_>
ok, thanks
<Mercurial_>
Hey I'm new to Crystal and I'm still a new programmer but I would like to help with Crystal
<Mercurial_>
is there any way I could?
Ven has joined #crystal-lang
<jhass>
sure, it's an open source project, entirely written in itself and I'm sure you'll run into a hole in the stdlib sooner or later (more sooner at this stage :P)
<jhass>
given the open class system, I tend to just monkey patch the holes in stdlib in my projects and then look at what would be good to contribute, add specs and open a pull request
<asbradbury>
3 minutes for a release compiler build, 22.5seconds for a non-release. Not too bad. Does --release only differ in the LLVM passes invoked?
<flaviu>
yep, it also means that the codegen isn't paralleled.
<asbradbury>
ah right, as you'd expect slightly less performance out of the generated binary from parallel codegen. It would be interesting to see how big an effect it has, and whether there is a middle ground
datanoise has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
<Mercurial_>
does anyone know of a text editor with Crystal syntax highlighting?
<Mercurial_>
hey, could anyone help me? sorry if im being a bother
<jhass>
Mercurial_: you aren't, you just need some patience on IRC ;)
<jhass>
that error means you're missing libgmp
<jhass>
the package is usually called libgmp-dev or gmp
<Mercurial_>
where would I get it/ look for it?
<jhass>
your package manager
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Mercurial_>
does this mean I'm using something iny my function that crystal doesn't support
<Mercurial_>
if I need another library?
<jhass>
no, it just means you don't have the library that crystal needs for your code installed
<asbradbury>
why is the syntax for type restriction on a instance variable ::, but just a single : for an argument? Does this resolve some ambiguity I'm not seeing?
<jhass>
it's a semantic difference, :: is a declaration, : is a restriction
<jhass>
see I can do it for locals too, declared it but never initialized it
<asbradbury>
jhass: that makes sense, thanks. Has there been any discussion of unifying the two? Or rather is there an advantage to differentiating between the two cases
<jhass>
none I'm seeing but I'd say they're really different things so having different syntax for them is actually a good thing
<Mercurial_>
whats the crystal equivalent of slice (from ruby)?
<jhass>
isn't slice defined on multiple core classes?
<jhass>
(in ruby)
<Mercurial_>
what do you mean?
<Mercurial_>
oh nvm I understand
<jhass>
best show a ruby snippet and ask for the equivalent ;)
<Mercurial_>
well for the function I'm working on, I would need to slice an array
<crystal-gh>
[crystal] PragTob opened pull request #754: "as" isn't used for comparisons like this (master...context-spec-grammar-fix) http://git.io/vIWaG
asterite has joined #crystal-lang
<asterite>
asbradbury: there's a reason why we used :: for type declaration
<asterite>
it's to avoid ambiguity. You have a ? b : c
<asterite>
is that "a ? (b : c) ..." or "a ? (b) : (c)"