<crystal-gh>
[crystal] bjmllr opened pull request #1241: use 0 as default argument to MatchData#begin, #end, #byte_begin, and #byte_end (master...begin0) http://git.io/vsZLt
havenwood has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
blue_deref has quit [Quit: bbn]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 240 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 240 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 245 seconds]
<Netfeed>
is it possible to call a function methodd on a string? obj.call("some_func") or something?
strcmp1 has quit [Quit: Leaving]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
BlaXpirit has joined #crystal-lang
Ven has quit [Client Quit]
Ven has joined #crystal-lang
havenwood has quit [Ping timeout: 255 seconds]
sailorswift has quit [Ping timeout: 255 seconds]
zamith has joined #crystal-lang
Rishav has joined #crystal-lang
<Rishav>
hi
<Rishav>
i have a question about running a project vs running a single cr file
<Rishav>
is there any specific command to run an entire project?
<Rishav>
can we define an entry point for the project in any config?
<Rishav>
my problem is that if i create an app project using crystal init app
<Rishav>
and then try to run it
<Rishav>
it runs fine
<Rishav>
but if i try to build it
<Rishav>
it gives me an error
<Rishav>
saying that a directory exists by that name
<Rishav>
i know i can use -o to specify output
<Rishav>
but i thought the compiled file would automatically go into the app directory
zamith has quit [Ping timeout: 244 seconds]
<Rishav>
ummm hi? :(
<Netfeed>
i created a bin/appname.cr that just requires src/appname.cr and runs a Appname::run! function, and then run it with crystal bin/appname.cr and i can also build it with crystal build bin/appname.cr, i dont know if that's best practice though
<Rishav>
thats pretty convoluted
<Rishav>
o.0
<Rishav>
i was hoping that there was some way to spcify the entry point and the compiled directory for any project
<Netfeed>
https://github.com/porras/crul <- that one has a file in the root-dir that does pretty much the same thing too
<Netfeed>
i wouldn't mind a better way, but i've not found one yet
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssvb has joined #crystal-lang
<Rishav>
i think i will raise an enhancement request for this
<Rishav>
i have been spoiled by nodejs package.json
<Rishav>
:D
kyrylo has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
BlaXpirit has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
trapped has joined #crystal-lang
infrashortfoo has left #crystal-lang [#crystal-lang]
kyrylo has quit [Read error: No route to host]
kyrylo has joined #crystal-lang
blassin has joined #crystal-lang
<blassin>
I think I found a bug on Crystal for Mac OS
<blassin>
but I get "Error: File / does not exist" on my Mac
<blassin>
or am I doing something wrong?
sleeper_ is now known as sleeper
<crystal-gh>
[crystal] ryanworl opened pull request #1244: Added HTML parsing to XML module, references #1240 (master...html_parser_with_libxml2) http://git.io/vsnSi
<BlaXpirit>
i need to allocate some memory but not fill it all with data
<BlaXpirit>
because the amount of data i have is less then the size of minimal allocated chunk
trapped has quit [Read error: Connection reset by peer]
<vegai>
ah, now I see
<vegai>
ok
trapped has joined #crystal-lang
<jhass>
BlaXpirit: my feedback stands, if it should go into stdlib keep the API to the usecases it's good at only, drop API where Array is performing equally or better
<BlaXpirit>
so if you need a deque but happen to need a remove an item in the middle just once... too bad?
<jhass>
We already have Array, StaticArray & Tuple, I really don't want the java disease of ArrayList, LinkedList, DoubleLinkedList and so on and you wonder all the time what to use now
<vegai>
BlaXpirit: conversion on line 78 seems redundant. size:Int => size.to_i
<BlaXpirit>
vegai, i think to_i is to_i32
<BlaXpirit>
jhass, Deque is an extremely important data structure. Python has it, C++ has it
* vegai
shrugs :)
<BlaXpirit>
maybe i'm wrong. in any case it would be optimized out if it does nothing
<jhass>
BlaXpirit: well, tbh I'd love to keep it as an external library, once we have a decent package manager getting it is a 30sec effort
<jhass>
IME not wondering what DS to use by default is a huge comfort, and keeping the redundant usecases in stdlib small is a good way to achieve that
<BlaXpirit>
what
<jhass>
you can always identify actual bottlenecks and then having a library to swap the default out with is great
<BlaXpirit>
jhass, i think this Deque has the same or better asymptotic complexity compared to Array for every method
<jhass>
so you want to replace Array with it?
<BlaXpirit>
no, that's not applicable
<jhass>
see, and now you have to explain a newbie what to use when because both is in stdlib
<BlaXpirit>
what's there to explain
<jhass>
whereas with an external library you can defer that to the "why's this slow" occasion
<jhass>
maybe at least add when to not use it if you want it in stdlib
<BlaXpirit>
people would only use it if they specifically search for it anyway
<Netfeed>
is it possible to call a method on an object by a string?
<BlaXpirit>
there is no good reason not to use it, unless you're missing some of Array's functionality
<jhass>
anyway, I think I made my point, I'd love to see the specialized stuff in well maintained external libraries and have the default tools only in stdlib
<jhass>
Netfeed: no, at best you can write a macro that dispatches to a method by generating a (huge) case when
<BlaXpirit>
deque is an extremely powerful tool that very many languages have in standard library
<Netfeed>
jhass: too bad
zamith has quit [Quit: Be back later ...]
<jhass>
Netfeed: keep in mind that there's no runtime, what call should crystal generate if it doesn't know what method to invoke at compile time?
<Netfeed>
would have made stuff easier for me right now though :P
<jhass>
use Ruby :P
<Netfeed>
that's not an option :)
<Netfeed>
i think that the vim extensions lags if you strings that is too long
<Netfeed>
haha, yeah, something is wrong, 13% cpu usage moving around in a file that's 84 rows :P
waj has joined #crystal-lang
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vscrD
<crystal-gh>
crystal/master 410ae60 Ary Borenszweig: Fixed definition of LibC.printf, and use C aliases in some places. Fixes #1243
waj has quit [Remote host closed the connection]
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: http://git.io/vscKd
<crystal-gh>
crystal/master 438b760 Ben Miller: MatchData: give default arguments to begin, end......
<asterite>
It works. But someone should compare the performance against a C implementation
<asterite>
On the other hand, if you write your extension with care, for example trying to avoid memory allocations, then it will probably be good enough, and (probably) easier to maintain than a C extension
<asterite>
avdi: luckily that's the only type annotation. I think most of the time they are in array/hashes constructors, captured blocks, and that's it
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vs8q4