Oliphaunte has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 265 seconds]
Philpax has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
willl has quit [Quit: Connection closed for inactivity]
Oliphaunte has joined #crystal-lang
matp has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
CompanionCube has quit [Ping timeout: 250 seconds]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Philpax has quit [Ping timeout: 244 seconds]
dminuoso_ has quit [Ping timeout: 250 seconds]
snsei has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
ponga has joined #crystal-lang
snsei has joined #crystal-lang
ome has joined #crystal-lang
dminuoso has joined #crystal-lang
pawnbox has joined #crystal-lang
dminuoso has quit [Ping timeout: 250 seconds]
dminuoso has joined #crystal-lang
dminuoso has quit [Remote host closed the connection]
<BlaXpirit>
neat
dminuoso has joined #crystal-lang
bjz has joined #crystal-lang
tomchapin has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tomchapi_ has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
mark_66 has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
Philpax has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
the_drow has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
trapped has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
onethirtyfive has joined #crystal-lang
Nicely has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 276 seconds]
onethirtyfive has joined #crystal-lang
Nicely1 has joined #crystal-lang
Nicely has quit [Ping timeout: 250 seconds]
Nicely1 has quit [Ping timeout: 250 seconds]
onethirtyfive has quit [Remote host closed the connection]
apotheon has quit [Read error: Connection reset by peer]
<FromGitter>
<abhijitiitr> Hello everyone. ⏎ I'm having problems building a simple program written in Crystal. I installed crystal using `brew install crystal` on a Macbook. I tried to build the program having just `puts "hello"` in it, which failed with the following error ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=57a9b64b613cc180367331e4]
<FromGitter>
<abhijitiitr> gcc-5: error: unrecognized command line option '-rdynamic' ⏎ Error: execution of command failed with code: 1: `gcc-5 -o "hello" "${@}" -rdynamic -levent -lpcl -lpcre -lgc -lpthread -ldl`
<jhass>
can you switch your environment back to clang?
<jhass>
no idea how on os x, probably some xcode or brew magic
<FromGitter>
<abhijitiitr> Thanks jhass. Works. Just had to change the `CC` environment variable.
<BlaXpirit>
i went too far with this project. i don't want to include autogenerated source code in version control, but then how do I let people browse it, particularly in the context of links from API docs
pawnbox has quit [Remote host closed the connection]
<BlaXpirit>
i'm considering generating syntax-highlighted source code along with the API documentation but seems like there's no nice API for that in crystal
<FromGitter>
<abhijitiitr> Please give suggestions
<crystal-gh>
[crystal] abhijitiitr opened pull request #3125: Fixed #3124: Added documentation for printf in MemoryIO (master...documentation/printf_memory_io) https://git.io/v6cvK
adam12 is now known as adam
adam is now known as Guest49086
trapped has quit [Read error: Connection reset by peer]
<FromGitter>
<CodeSteak> Hey, I was searching for a small persistent key-value for Crystal, that does not depend on an external database. Unfortunately I didn't find one. So I built one. If you are intressed please check out [Nuummite](https://github.com/CodeSteak/Nuummite) :smile:
<FromGitter>
<CodeSteak> @jhass I was looking for something persistent. And the code of the Kiwi FileStore didn't look good to me. Writting a File for every Key-Value-Pair is probably bad.
<RX14>
yeah leveldb is probably what you want
<RX14>
production ready and fast
<jhass>
oh, I somehow read over the persistent
snsei has joined #crystal-lang
<txdv>
how does crystal leveldb work?
<txdv>
the underlying calls to IO are blocking
<txdv>
doesn't implement the style of crystal where it just ejects the current fiber and takes some other
snsei has quit [Ping timeout: 250 seconds]
<RX14>
txdv, it just blocks the current fiber
<RX14>
however, the linux kernel doesn't support nonblocking file read and writes
<RX14>
so any fileread and writes in crystal are blocking too
<RX14>
so in reality it doesn't matter
<txdv>
so if crystal can't provide callback IO functions to leveldb, then the leveldb bindings are worthless, because they block the entire fiber
<RX14>
they aren't worthless just because they block the fiber!
<RX14>
and, as i said
<RX14>
all disk IO in linux is counted as immediate
<RX14>
and cannot be nonblocking or evented
<RX14>
so they block the fiber for the same amount of time as a crystal IO call
<RX14>
so it makes no difference
Nicely has joined #crystal-lang
<pduncan>
txdv: the attitude "it doesn't fit my use case, therefore it's useless" is not very constructive
<txdv>
not one fiber, all fibers
<RX14>
txdv, the only way to write it that doesn't block fibers is to use a thread pool for IO
<RX14>
i don't think you understand what i'm saying
<RX14>
it's as fast as it can be
<RX14>
there's no way to use actual file file descriptors with libevent or epoll
<RX14>
there's no way to do work in another fiber while an IO call is hapenning
<RX14>
it's simply impossible to do what you ask
<RX14>
apart from using thread pools for IO
<txdv>
i was planning on doing the impossible
<txdv>
if an api accepts custom functions for file operations, couldn't you just pass the crystal functions?
<RX14>
what?
<txdv>
i guess you wont understand
dminuoso has quit [Ping timeout: 250 seconds]
<RX14>
anyway, it looks like the nodejs leveldb binding uses multiple worker threads to implement this
<RX14>
which is a route the leveldb binding could go down
<RX14>
but it's not a problem with the leveldb api
<txdv>
mose of the libs use fopen, fread, fwrite, fclsoe
<txdv>
crystal has a very specific custom implementation for those, using fibers and libevent
<RX14>
i know
<txdv>
instead of blocking it just switches the fiber
<RX14>
and i'm saying
<RX14>
those do not work with files
<txdv>
so I create 4 functions with crystal that have the same signature and use the crystal way and just pass those functions to leveldb to use them
<txdv>
o yeah, i remember, epoll works only with the network stack
<RX14>
yes, sa i said you need to use worker threadpools
<RX14>
which leveldb doesn't implement itself
<txdv>
well, linux does have some shitty aio api for files too
<txdv>
its just nobody uses it because the guy who wrote rtorrent said that it is shit
snsei has joined #crystal-lang
<txdv>
also works only with O_DIRECT
<txdv>
i wonder how nobody tackled this problem yet ...
<RX14>
yes
<txdv>
I would do it if I had the time! Or the money
<txdv>
I guess everyone else is saying the same
dminuoso has joined #crystal-lang
<txdv>
the code that jhass linked to though...
<txdv>
it calls wait_readable which reschedules the current fiber?
<jhass>
the question is when EGAIN happens with files though ;)
<jhass>
(never)
<crystal-gh>
[crystal] abhijitiitr opened pull request #3126: Fix #3125: Added documentation for printf in the MemoryIO class (master...documentation/printf_memory_io) https://git.io/v6cqx
<txdv>
so file reads in crystal block everythign too
<txdv>
that is not nice
snsei has quit [Ping timeout: 240 seconds]
<txdv>
that wouldn't have happend if somebody left the libuv implementation
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<RX14>
libuv would be nice i guess
pawnbox has quit [Remote host closed the connection]
<jhass>
waj tried libuv first but switched to libevent then
<RX14>
might be worth having another look if only for file IO
<jhass>
and link against both, libuv and libevent? meh
<jhass>
I think at the end of the day we should eventually get rid of either
<RX14>
why both?
<RX14>
i meant look at switching
<RX14>
not look at using uv for files
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/v6cOu
<crystal-gh>
crystal/master e86e4b2 Ary Borenszweig: Compiler: make stdout configurable. Related to #2981
Philpax has quit [Ping timeout: 240 seconds]
Nicely has quit [Quit: Leaving.]
pawnbox has joined #crystal-lang
dminuoso has quit [Remote host closed the connection]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/v6csB
<BlaXpirit>
any plans for Shards to support downloading from a URL that is not git?
pawnbox has quit [Remote host closed the connection]
<BlaXpirit>
(archive or something)
pawnbox has joined #crystal-lang
<crystal-gh>
[crystal] abhijitiitr closed pull request #3126: Fix #3125: Added documentation for printf in the MemoryIO class (master...documentation/printf_memory_io) https://git.io/v6cqx
snsei has quit [Ping timeout: 258 seconds]
Oliphaunte has quit [Remote host closed the connection]
mukik182 has joined #crystal-lang
mukik182 has quit [Client Quit]
elbow_jason has quit [Ping timeout: 276 seconds]
<jhass>
haven't seen anything immediate
<jhass>
if it's about mercurial, that's probably ok to do
<jhass>
somebody has to write the resolver and that's it
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
aemadrid has quit [Quit: Connection closed for inactivity]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
ponga has quit [Quit: Connection closed for inactivity]
pduncan has quit [Read error: Connection reset by peer]
ylluminate has joined #crystal-lang
<crystal-gh>
[crystal] kachick opened pull request #3128: Fix duplicated iteration issue of Enumerable#in_groups_of (master...fix-todo-of-enumerable-in_groups_of) https://git.io/v6cj5
Oliphaunte has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
Guest49086 is now known as adam12
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
<FromGitter>
<sumproxy> Hi all, excited to learn about crystal. Can someone please tell me what is the current situation with parallelism and its future in crystal?
<BlaXpirit>
sumproxy, currently parallelism is basically not there, concurrency is based on fibers within one thread, in near future it looks like the fiber model will stay but will run in a thread pool
<FromGitter>
<sumproxy> @BlaXpirit are other models considered to be added, what's the status of the discussion if any?
<FromGitter>
<sumproxy> and what's the development progress (your estimate for the thread pool)
<BlaXpirit>
i have no reliable information on this
<FromGitter>
<sumproxy> :(
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
<RX14>
i don't think the threadpool has actually been started, just cleanup tasks needed before starting at the moment
<RX14>
but asterite is the guy to ask
<FromGitter>
<sumproxy> hopefully it works out well
<FromGitter>
<sumproxy> seems it's almost stalled :(
<rkeene>
Tcl's threading model is awesome, FWIW.
snsei has joined #crystal-lang
willl has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
<FromGitter>
<sumproxy> @rkeene you mean Tcl language?
<apotheon>
rkeene: What's so great about Tcl's threading model?
<apotheon>
jhass: After some careful consideration, I don't think I'm going to bother submitting a ticket for a license change. Given the large numbers of contributors, and the fact I'm not one of them, and the fact I'm unlikely to even use Crystal unless a license change happens . . .
<apotheon>
jhass: . . . I don't feel like I have a strong enough argument at hand to avoid just getting a label as a troll, even if that's not my actual intention (intentions often have nothing to do with the labels people apply).
<apotheon>
jhass: Thanks for the suggestion, anyway.
<jhass>
it's sad to hear that you won't use it for that reason
<crystal-gh>
[crystal] paddor opened pull request #3129: String#tr: don't crash if replacement is empty (master...master) https://git.io/v6CgC
<apotheon>
If I have other alternatives that are roughly equivalent for my needs, and have better licensing, I tend to use those over the things that have worse licensing.
<apotheon>
I only have so much time, so I only tend to actively pursue the things that most interest me -- and a suboptimal license means a number of potential problems, reducing the amount of interest I have.
<apotheon>
I dislike dealing with legal complications. It's a significant stressor for me.
<jhass>
well, that sounds like real world implications you could base your argument on
<jhass>
and that I still think would a worthwhile discussion be possible if based upon
<dom96>
apotheon: huh, what was the reason you decided against Nim again?
<apotheon>
It's hard to make a case for what *could* happen *if* I chose to use the language. If I was currently using it, and I foresaw trouble, that'd be a different story.
<apotheon>
dom96: There are some things I don't really love about the language design decisions, and I've been distracted by C and work, plus Araq is kind of an asshole.
<dom96>
Funny, I didn't even think to check Crystal's license. Didn't expect Apache.
<apotheon>
dom96: I wouldn't be opposed to learning Nim if a really good use case (and opportunity) for it came up in my life, but I'm not going to actively pursue it any time soon. Crystal has more potential for that, given its Rubyishness.
<dom96>
apotheon: pity
<apotheon>
I really prefer software to which I'm willing to contribute code, so that I can help guide its development while I'm using it and help speed up bugfixes when they affect me. A license that comes with substantial legal complications turns me off of contributing code pretty quickly, though.
<apotheon>
jhass: If someone else, with more of a direct stake, submitted a ticket for the license, I could feel more comfortable joining the discussion, but I've had a couple of bad experiences with actually reinforcing an existing license decision by opposing it without sufficient community involvement credentials to satisfy some of the developers.
<apotheon>
dom96: It's not like I actually used Araq's attitude as a reason to not use Nim, but I drifted away from thinking about it because I wasn't in the channel, and I wasn't in the channel because of his attitude.
<jhass>
well, I can't do it for you as I can't even tell whether I agree with your reasons yet or not, since I didn't hear of any real world implications yet
<dom96>
I guess Araq should simply do what most programming language developers do: just not be in the channel.
<dom96>
Correct me if I am wrong but asterite seems to rarely be here for example
<BlaXpirit>
dom96, nah, wrong
<jhass>
ideally you would have examples of projects/people run into trouble before due to using apache over another license
<jhass>
and tbh. I think so far you sound way more reasonable than most people that feels strongly about licenses, so I would prefer a well reasoned discussion started by you :)
<jhass>
than something we have to shoot down quickly because it's not much more than "Apache sucks, use this thing I prefer instead"
<apotheon>
Part of the problem with license discussions is that most of the problem with complicated licenses is related to looming dangers and chilling effects rather than a lot of historical evidence of bad things happening.
<rkeene>
sumproxy, Yes, Tcl the language
<apotheon>
The GPL family is kind of a strange duck in that the GNU project and the FSF have gone out of their way to make many of the potential problems with those licenses very obvious by threatening to sue a lot of people.
<rkeene>
apotheon, It uses the apartment threading model, where a newly created thread has a new interpreter and the only way to interact with other threads is to send messages to their event loop
<apotheon>
rkeene: sounds a bit like multiprocessing, actually
<rkeene>
... threading is a form of multiprocessing...
<apotheon>
not exactly
<rkeene>
What makes you think that ?
<apotheon>
It allows multiprocessing, sometimes, but it's not a distinct "process" by definition like what fork gives you.
<apotheon>
multiple PIDs vs. threads in one PID on multiple cores
<apotheon>
We're talking about different things.
<jhass>
well, the thing about chilling effects is that they're hard to measure, how do we know what we currently have has a greater chilling effect than what we move to?
<apotheon>
I've gotta run, though. Back later.
<rkeene>
Processing does not imply "processes" in that sense.
<apotheon>
jhass: Yes, they are hard to measure, which is why I prefer to have a more solid personal stake before doing something like submitting a ticket.
<apotheon>
Seriously, gotta run along.
<apotheon>
rkeene: Like I said, we're talking about different things.
<jhass>
hf, nice talking to you
<apotheon>
later
<rkeene>
But, they are threads and you can have "thread shared variables" with the TSV package, but they are always mutex-controlled
<BlaXpirit>
jhass, i know that i once wanted to base my project off of something apache-licensed, and i had no idea what i was supposed to do to comply with the license
<BlaXpirit>
rkeene, this is not gonna be that far off. you will be expected to not use shared state, only channels
<BlaXpirit>
but if u want, u can use mutexes
jwaldrip has joined #crystal-lang
<BlaXpirit>
(to clarify about apache license) it's ok if the library stays separate from your project and you just "use" it, but to fork and extend upon something apache-licensed, or include a small source file - what a pain
<FromGitter>
<fridgerator> perhaps a loaded question, perhaps not… is crystal close to being in BETA state?
<BlaXpirit>
sure, a loaded question, "beta" has very little meaning
<rkeene>
With Tcl you never have to use mutexes (in fact, I never have -- though they are available). You can also hand channels off to other threads, but not share them.
<FromGitter>
<fridgerator> Well I think of beta having fewer breaking changes between versions than an alpha… but you’re right, its different for each person / project. Was just curious
<BlaXpirit>
fridgerator, in this sense i think the beta period will be small because the community will strive for either guaranteed bk compatibility or proper ability to make important changes
<rkeene>
Example thread in Tcl: set tid [thread::create { do your work here, when this is done the thread will exit }]; while that thread is running you can send it messages: thread::send $tid { puts "GOT IT !" } (which will run "puts" in the thread and wait for that event to be processed and return its result)
<rkeene>
If you just want to send the message and don't care about waiting, thread::send -async ... if you do care about the result, but only some time in the future, you can thread::send -async ... resultVar then wait in your event loop for resultVar to change (vwait resultVar)
Oliphaunte has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 244 seconds]
Philpax has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<asterite>
apotheon: what license would you need for Crystal?
<asterite>
To be honest, we put a license file just because there was an issue for it, we aren't really interested in lawyers and such, we just want a good language
<asterite>
I'm looking at this: http://choosealicense.com/licenses/ and still can't clearly understand the difference between MIT and Apache :-( (maybe it's my poor English related to the terms used there)
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter>
<cjgajard> As I get, reading http://choosealicense.com/licenses/ and http://copyfree.org/standard/rejected , there are 3 things special about Apache (and different from MIT) ⏎ ⏎ 1. It's derivates CAN'T use the original work's name, logo or any other thing that identifies it. ⏎ 2. If the original work had won any patent, it's derivates CAN use it too (vague example: "no-one else can make a language using llvm", project based on
<FromGitter>
<cjgajard> Within http://choosealicense.com/licenses/ options, only Mozilla Public License 2.0 disallow trademarks use, but Same License condition is even worse than Apache... As http://copyfree.org/standard/rejected says, COIL and MS-PL seems good options (have 1 and 2, but don't have 3)
<apotheon>
asterite: I'd prefer as simple and permissive as possible. Anything on the Copyfree certified licenses list would be fine. I have favorite licenses -- DPL or OWL, or (if you're into patent clauses -- the main reason people tend to pick Apache these days) COIL. Amongst the most popular licenses, I like ISC License, MIT/X11 License, and Simplified BSD License.
<apotheon>
asterite: ALv2 (Apache License version 2) comes with some complicated legalese only really necessary because of a couple of restrictive clauses, one of which requires bookkeeping (notices of changes to any and all files) from the "original" and the other of which requires observance of some special status of any file called NOTICE in the project.