RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.1 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
soveran has quit [Ping timeout: 240 seconds]
<FromGitter> <jots_twitter> on `Crystal 0.20.0 [b0cc6f7] (2016-11-22)` if I do `crystal init app blah` the shard.yml file says `crystal: 0.19.4` anything to worry about?
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <raydf> nop
<FromGitter> <raydf> you'll keep compiling the lib or app with the current crystal installed version
<FromGitter> <raydf> 1) 20
dtzu has quit [Ping timeout: 250 seconds]
DTZUZU has quit [Ping timeout: 256 seconds]
dtzu has joined #crystal-lang
DTZUZU2 has joined #crystal-lang
<FromGitter> <samueleaton> I had a question about "modules as interfaces" at the end this issue thread: https://github.com/crystal-lang/crystal/issues/3489#issuecomment-268408664 ⏎ ⏎ Any help would be awesome.
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
A124 has joined #crystal-lang
ponga has quit []
pawnbox has joined #crystal-lang
<FromGitter> <cjgajard> @samueleaton #1294 explains whats happening there. `[MyClient.new, MyClient.new] of MyProtocol::MyInterface` makes it work (because when you are using an array literal it get infered to be the "smallest" type it can, so you need to force it to use a bigger type)
<DeBot> https://github.com/crystal-lang/crystal/issues/1294 (Inconsistent variance in generics)
<FromGitter> <samueleaton> @cjgajard works great. 👍 thanks!
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
akwiatkowski has joined #crystal-lang
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
lacour has quit [Quit: Leaving]
Raimondii has joined #crystal-lang
Raimondi has quit [*.net *.split]
Raimondii is now known as Raimondi
Philpax has joined #crystal-lang
Philpax has quit [Client Quit]
Philpax has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
bjz has quit [Ping timeout: 256 seconds]
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
gloscombe has joined #crystal-lang
user9998 has joined #crystal-lang
<user9998> Is there a method for adding slashes before special characters in a string?
<FromGitter> <sdogruyol> @user9998 you might need to use regex
<user9998> @FromGitter ah it's the same as in Ruby (dump). Thanks anyway.
<FromGitter> user9998, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/crystal-lang/crystal
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
mark_66 has joined #crystal-lang
akwiatkowski has joined #crystal-lang
user9998 has left #crystal-lang ["Leaving"]
user9998 has joined #crystal-lang
Nulldata has joined #crystal-lang
<Nulldata> Hey
soveran has quit [Remote host closed the connection]
<RX14> hi
<FromGitter> <andreaTP> @RX14 I finally read the article you link thanks a lot, but that does mean that every time you compile a program even the whol stdlib is compiled
<RX14> yep
<RX14> but it's super fast anyway
<FromGitter> <andreaTP> so the question become how to redistribute libraries? via sources?
<RX14> yes
<FromGitter> <andreaTP> uhmm thanks for the explanation!
<Nulldata> Hmm, can anyone explain why the `unless` isn't eliminating the possibility of the field being nil here? https://gist.github.com/nulldatamap/43540c4212e8160dde8b55b33094133b
<RX14> @andreaTP crystal will eventually have incremental compilation to help compile times
<RX14> the compiler itself is a very big crystal program, and it only takes ~15 seconds to do type analysis for
<RX14> then another ~15 seconds to emit native code and link
<FromGitter> <molovo> @Nulldata it doesn’t work with class variables. You’ll need to assign it to a local variable, and then compare against that. Quick rough example base on your code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=585a646e61e516c1578e8ec3]
<FromGitter> <RX14> actually, you can write it like this: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=585a649baf6b364a29dca770]
bjz has quit [Ping timeout: 260 seconds]
bjz_ has joined #crystal-lang
<FromGitter> <RX14> oops
<RX14> not used tog gitter
<RX14> like this
<Nulldata> Ah, thanks. Is there any plans on actually making it work with instance variables?
<RX14> no, it's a feature
<RX14> that it doesn't work
<RX14> another thread could change the value of an instance variable inbetween the type check and you using it
<RX14> so the only way to be sure that the type is correct is to make a local copy of it
<FromGitter> <molovo> @RX14 Ah, that’s quite a bit nicer to write. I always thought the `.nil?` call had to be explicit. Good to know
<Nulldata> Oh yeah, I'm too used to the thread safety model of Rust. Makes sense
<RX14> you don't need .nil? unless you can get a falsey value which isn't nil
<RX14> i.e. false
<Nulldata> too*
<RX14> if it can be false or nil you need .nil? to disambiguate
<RX14> otherwise you can reply on nil's falsiness
<FromGitter> <molovo> @RX14 makes total sense
<RX14> rely*
akwiatkowski has quit [Ping timeout: 264 seconds]
<Nulldata> I'm kinda ideologically opposed to other values than booleans being treated as truthy and falsey, so I try to keep my conditions explicit :P
<Nulldata> But thanks for the tip anyway :)
bjz_ has quit [Max SendQ exceeded]
bjz has joined #crystal-lang
<FromGitter> <molovo> Actually, in that instance I think you'd need to be explicit, since `lowest_time_left` could be `0`
<RX14> 0 isn't falsey
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
Nulldata has quit [Quit: ChatZilla 0.9.93 [Firefox 50.1.0/20161208153507]]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
gloscombe has quit [Quit: Lost terminal]
splitty_ has joined #crystal-lang
<splitty_> Hey :)
<RX14> hi
Philpax has quit [Ping timeout: 248 seconds]
<splitty_> I need.. a static array. In a freestanding environment.
<splitty_> Seems impossible.
<splitty_> Any idea how to do this?
<RX14> what do you mean "in a freestanding environment"?
<RX14> can you give an example of what doesn't work?
<splitty_> RX14, I'm writing a proof-of-concept i686 kernel. I'm cross-compiling to i686-unknown-none with --prelude=empty
<RX14> and StaticArray doesn't work?
<splitty_> I can declare a StaticArray, but []= is not implemented
<splitty_> Which makes it useless for me
<splitty_> I also can't use to_unsafe or to_slice or anything like that
<RX14> you can just `require "static_array"`
<RX14> it doesn't *seem* to rely on any parts of the stdlib
<RX14> that you wouldn't have
<RX14> oh actually
<splitty_> It depends on Enumerable(T) and Iterable(T)
<RX14> oh yes
<splitty_> It's also really hard to find information on the compiler primitives.
<splitty_> I can't use the source files because they implement stuff I don't have
<splitty_> But I can't find the "raw" source-files that the compiler uses for cross-compiling without prelude.
<RX14> well this is the file required with --prelude=empty: https://github.com/crystal-lang/crystal/blob/master/src/empty.cr
<RX14> it just binds the compiler primitives
<RX14> and adds a main
<splitty_> Ah, I see
<RX14> also the compiler defines some types internally
<splitty_> This is helpful. Didn't know where to look for that
<splitty_> Does Crystal have inline assembly?
<RX14> yup
<splitty_> I could probably abuse the stack for that
<RX14> example
<splitty_> Awesome
<RX14> you might have to check the llvm IR docs for the details of how `asm` work though, and it's not used much so might be buggy
<RX14> but it should be most the same as C with slightly modified syntax for basic things
<splitty_> I can probably figure that out, I've been using LLVM for my own compilers
pawnbox has quit [Remote host closed the connection]
<splitty_> What I'm trying to do is very basic, so I guess it shouldn't be too hard
<crystal-gh> [crystal] MakeNowJust opened pull request #3746: Use private macro instaed of :nodoc: (master...fix/raise/private-macro) https://github.com/crystal-lang/crystal/pull/3746
<RX14> i don't know loads about kernel or low-level development so all I can say apart from pointing out what crystal provides is good luck
<RX14> splitty_, here's an i386 kernel for reference although it might be nothing new to you https://github.com/lbguilherme/os-crystal
<splitty_> RX14, I've taken a look at that kernel. It's very basic and my kernel already has more features, so I can't really use it as a reference :)
<RX14> ok
user9998_ has joined #crystal-lang
user9998 has quit [Ping timeout: 245 seconds]
<FromGitter> <asterite> splitty: you might need to re-implement some methods from static array... well, just copy-paste them into your program. Right now the std isn't though much to be used without the rest of the std (like, StaticArray includes Enumerbale and Iterable, like RX14 mentioned)
user9998_ has quit [Read error: Connection reset by peer]
user9998 has joined #crystal-lang
<FromGitter> <asterite> Method never have "magic", StaticArray#[]= just uses pointer and assignments. The only methods that have "magic" (well, hardcoded to LLVM instructions to a bunch of instructions) are in primitives.cr
<splitty_> FromGitter, yeah I'll see if I can copy/paste some methods from StaticArray
<FromGitter> splitty_, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/crystal-lang/crystal
<splitty_> Oops :D
<splitty_> asterite, I'm not sure whether that'll work, because I don't have a Heap yet
<splitty_> Maybe I should just stop and get the heap going first :P
<RX14> splitty_, using foo = uninitualized StaticArray uses a stack
<RX14> well
<RX14> it allocates the staticarray on the stack
<RX14> splitty_, if you get a malloc/realloc/free interface to a heap, you should be able to do something like this: https://github.com/crystal-lang/crystal/blob/master/src/gc/null.cr
<RX14> but you'll still have to manually free objects
pawnbox has joined #crystal-lang
stnly has quit [Remote host closed the connection]
stnly has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #3747: Allow 'private macro' inside classes (master...feature/macro/private) https://github.com/crystal-lang/crystal/pull/3747
<crystal-gh> [crystal] sdogruyol opened pull request #3748: Fix parser doc (master...master) https://github.com/crystal-lang/crystal/pull/3748
<crystal-gh> [crystal] bcardiff closed pull request #3748: Fix parser doc (master...master) https://git.io/v1pe8
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://github.com/crystal-lang/crystal/commit/ac304611a3d2c70809000763ff220065fc2d50ce
<crystal-gh> crystal/master ac30461 Serdar Dogruyol: Fix parser doc (#3748)
<crystal-gh> [crystal] RX14 opened pull request #3749: Add Time::Span division by itself (master...feature/timespan-divide) https://github.com/crystal-lang/crystal/pull/3749
Raimondi has quit [Quit: WeeChat 1.6-dev]
<FromGitter> <firejox> hi all :D
<FromGitter> <sdogruyol> @firejox hey
<FromGitter> <fridgerator> yo
ponga has joined #crystal-lang
akwiatkowski has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ac30461 (master - Fix parser doc (#3748)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/185791793
<FromGitter> <firejox> I have write a simple async-await implementation like C#. :smile: ⏎ https://gist.github.com/firejox/4f1d1fd16adcad49b478601fd24b1867
akwiatkowski has quit [Read error: Connection reset by peer]
akwiatkowski has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <molovo> @firejox that looks like it could be useful. Any chance you could publish it as a library?
soveran has quit [Remote host closed the connection]
<Yxhuvud> firejox: Hmm, there was a really good in depth article on the building blocks behind async on HN a week or so ago, written by one of the implementors, but I can
<Yxhuvud> 't find it again :(
<FromGitter> <firejox> @molovo yeah, I would do it in the future.
<Yxhuvud> found it. long as heck, but with plenty of interesting stuff
<RX14> @firejox that's some very interesting code
<RX14> although seems a bit pointless when we already have CSP in the stdlib
<FromGitter> <firejox> @yxhuvud Hmm, Mark it as favorites :D
mark_66 has quit [Quit: Leaving.]
<FromGitter> <firejox> @RX14 I think async await can provide some light way for concurrent
<FromGitter> <firejox> It can use less memory and a little bit slower
<RX14> the current CSP doesn't use much memory...
<FromGitter> <firejox> @RX14 but it would allocate 8M for each fiber, right?
<RX14> spawn 10000 fibers and see!
<Papierkorb> firejox, virtual memory is awesome
<RX14> ^
mgarciaisaia has joined #crystal-lang
user9998 has quit [Quit: Leaving]
<FromGitter> <firejox> OK, It look fine now. :smile:
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<RX14> linux seems to limit virtual memory to 256gb
<crystal-gh> [crystal] ysbaddaden closed pull request #3746: Use private macro instaed of :nodoc: (master...fix/raise/private-macro) https://git.io/v1xNU
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://github.com/crystal-lang/crystal/commit/b15978d55e4b4cb50c64962172e6110e5ca8a432
<crystal-gh> crystal/master b15978d TSUYUSATO Kitsune: Use private macro instaed of :nodoc: (#3746)
pawnbox has joined #crystal-lang
<Papierkorb> RX14: Due to the lower/upper part of memory in x64
<RX14> it's so low?
<RX14> it can't be
<Papierkorb> Currently, yes. There's a huge chunk of memory in x64 which is "non-canonical"
<Papierkorb> We don't have 2⁶⁴ Bytes for real :)
<Papierkorb> but wasn't it 256TiB?
<RX14> there's servers with > 256gb of memory
<Papierkorb> I think the x64 addressing limit atm is 256TiB iirc
<RX14> i'm in the process of asking stackoverflow
<RX14> 140TiB
<RX14> for userspace
<Papierkorb> RX14: I think I had processes going above those 256GiB in VIRT
<RX14> it's between 10 and 100,000 fibers
<Papierkorb> I can't spawn 100k fibers, 10k work fine
<RX14> same
<RX14> 8KiB * 10,000 is ~80gb
<RX14> 800GiB is over the 256GB observed limit
<RX14> sorry
<RX14> 8MiB
<RX14> should be about 30,000 stacks
<Papierkorb> I can spawn exactly 32734 (additional) fibers
<Papierkorb> htop shows the calculated 255GiB VIRT usage, and 134M RESidential memory
<RX14> 32768 is the theoretical limit
<RX14> so
<RX14> only 34 off
<RX14> cool
<Papierkorb> Yep it's not far off
<RX14> well it's a pretty high limit
<RX14> actually
<Papierkorb> It should be enough for now, but I'm sure there are edge cases where that's not enough
<RX14> actually
<RX14> if you're handing 100,000 HTTP requests per second
<RX14> and your fibers last for longer than 32ms
<RX14> sorry
<RX14> 320ms
<RX14> then you'll breach that limit
<Papierkorb> Not even that, you can't have more than 32k concurrent connections in a chat server
<RX14> yup
<Papierkorb> Which is bad tbh
<RX14> yep
<Papierkorb> Screw that edge case, it's way too low
<RX14> erlang completely swamps us in that regard
<Papierkorb> Each connection in the torrent shard consumes 3 - 5 fibers. Even if you'd lower that to two you're doomed for this use-case
<Papierkorb> (Using ^ as somewhat real-world example)
<RX14> 6000 peers?
<Papierkorb> Oh btw how's your IO select going? with that I can shave one fiber off :)
<RX14> thats quite high
<RX14> uhh
<RX14> well
<RX14> it just needs finishing off I think
<RX14> i.e. adding select actions for all the other things on IO
<RX14> IO::FileDescriptor*
<Papierkorb> With many peers and the DHT it could get to approx 5k fibers
<Papierkorb> Far off those 32k, but then torrents are not about sleeping connections like chat servers
<Papierkorb> How does Go do it?
lacour has joined #crystal-lang
<Papierkorb> Too bad macros can't be used on instances
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> well i don't think that would really make sense
soveran has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#b15978d (master - Use private macro instaed of :nodoc: (#3746)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/185824097
<DeBot> https://github.com/crystal-lang/crystal/pull/3746 (Use private macro instaed of :nodoc:)
<FromGitter> <andreaTP> Is there any effort on the actor model? 32k fibers looks limiting IMO
<RX14> yeah it is quite limiting
<FromGitter> <andreaTP> I mean scheduling executions on top of a thread pool is quite common I.e. in Akka for Scala
<RX14> hopefully we can find away around the limit
<RX14> number of fibers hasnt been really been optimized at all
<FromGitter> <andreaTP> And actors are object themselves :-)
<FromGitter> <andreaTP> Fibers in Crystal looks like coroutines at a first glance, is that true?
<RX14> yes
<RX14> they're cooperatively scheduled coroutines
<RX14> which works very well for io-based workloads
<FromGitter> <andreaTP> I believe, but not for concurrency and distribution
<RX14> what do you mean? coroutines enable concurrency in crystal
<RX14> maybe you mean parallelism
<FromGitter> <andreaTP> @RX14 do you know any library implementing actor model here around?
<RX14> not aware of one
<RX14> i've thought of doing it
<RX14> but I would use 1 fiber per actor anyway
<RX14> and let crystal schedule fibers onto a threadpool when that's implemented
<FromGitter> <andreaTP> I mean transparent execution of concurrent tasks like "method calls" in another programming language
<FromGitter> <raydf> Do you have a real scenario with 100,000 http connections per second for 1 server?
<RX14> benchmarking
<RX14> is a pretty real-world scenario
<FromGitter> <andreaTP> It sounds like I've found a project to let me go in depth in Crystal :-)
<FromGitter> <andreaTP> I do not care HTTP connections themselves
<FromGitter> <raydf> In my experience you'll have the database bottlenecking the app before the http server
<Papierkorb> raydf, 100k requests/sec is reasonable to expect, if you're only sending off static data, the only limit should be the max file handle count
<FromGitter> <raydf> maybe for stats analyzing or something similar
<FromGitter> <andreaTP> the problem is to properly manage concurrency at any level
<FromGitter> <andreaTP> What about distribution?
<Papierkorb> to what?
<RX14> @raydf the spawns per second * fiber running length is what matters for hitting the fiber limit
<FromGitter> <andreaTP> Of fibers on a network
<Papierkorb> huh?
<FromGitter> <andreaTP> I mean Actors here :-)
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<FromGitter> <andreaTP> Transparent communication between fibers let you spawn on the same machine if possible or on the network In a cluster otherwise
<FromGitter> <andreaTP> And the primitives needed to do that are pretty limited
<Papierkorb> Um, before even thinking if we want that complexity monster in the stdlib (wtf?), real threading would be nice..
<crystal-gh> [crystal] asterite closed pull request #3749: Allow Time::Span to be divided by Time::Span (master...feature/timespan-divide) https://git.io/v1p0f
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v1p0t
<crystal-gh> crystal/master 5ca344e Sijawusz Pur Rahnama: Add :nodoc: to Class#crystal_instance_type_id
<FromGitter> <andreaTP> But I like this discussion please go on, it looks like Crystal is mainly intended to handle server code for web app and this is what it is optimized on
<FromGitter> <raydf> Do golang have any example of this kind of performance with go corrutines?
<Papierkorb> andreaTP, I'm not using Crystal for webapp stuff at all
<Papierkorb> And the language is neither "optimized for it"
<FromGitter> <andreaTP> I started programming in scala because of native actors implementation it is not a monster pretty simple and powerful IMO
<crystal-gh> [crystal] asterite closed pull request #3740: Fix argument notation in docs (master...fix-doc-args-notation) https://git.io/v1NCR
<crystal-gh> crystal/master aafdafb Sijawusz Pur Rahnama: Fix argument notation in docs
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://github.com/crystal-lang/crystal/commit/aafdafba0fdeed73aca6bec795e74999bfb42a63
<RX14> while crystal might not be optimized *for* web stuff, it's web stuff is pretty fast
<FromGitter> <raydf> Look at this article with a similar problem: http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/
<Papierkorb> Like the SNES emulator, operating system kernel and torrent stuff is. Shits fast, yo
<RX14> 1 million per minute?
<RX14> its not really that fast
<FromGitter> <andreaTP> @Papierkorob so it seems that concurrency is managed at a low level respect the rest of the lang that is really high do not you think so?
<RX14> especially as go is multithreaded
<FromGitter> <raydf> They solved it using a work job scheduler with channels
<FromGitter> <raydf> that's why i'm asking about the simple usage of spawn
<Papierkorb> andreaTP, mh? What's bad about fibers? when there's a thread pool, programs will be multi-threaded by default, you just spawn something you want to do concurrently. And they're not as expensive as Threads, way less so
<FromGitter> <andreaTP> Akka uses a Thread pool under and so does Erlang
<FromGitter> <andreaTP> I mean Actors normally have 300 KB of memory footprint fibers here is 8 MB
<Papierkorb> 300Kib?!
<Papierkorb> Fibers are 4KiB each
<FromGitter> <andreaTP> This is simply different
<FromGitter> <andreaTP> What is 8 MB about so? Sorry maybe I miss it
<RX14> well the amount of memory a crystal fiber uses is dominated by it's stack size
<Papierkorb> Many people today who're confusing virtual memory with memory usage. Looks like the docs should mention that.
<RX14> crystal fibers have a maximum stack size of 8MiB
<RX14> but at the beginning they will only be 1 page
<FromGitter> <andreaTP> Aaaaaaa
<RX14> i.e 4KiB
<RX14> so creating a crystal fiber involves instantiating a singla class
<FromGitter> <andreaTP> I really think this should be mentioned in the docs :-)
<RX14> then creating (or checking out from the pool) a stack
<RX14> well
<RX14> fibers are sort of low level
<Papierkorb> andreaTP, knowing about virtual memory is "common knowledge" to some.
<RX14> you're not meant to know how they work
<FromGitter> <andreaTP> Now everything looks much more reasonable
<RX14> just "use spawn"
<RX14> the best advice is basically use spawn and channels
<RX14> and then
<RX14> optimize later
<FromGitter> <andreaTP> I know about virtual memory but docs talk about memory itself and doesn't mention that 8mb is the bound
<Papierkorb> *scrolls through actor docs* doesn't look much different to the spawn/channel combo
<FromGitter> <andreaTP> It is not indeed
<FromGitter> <raydf> Actors can be distributed by network i believe?
<FromGitter> <raydf> at least in akka
<RX14> yeah thats basically the difference
<FromGitter> <andreaTP> To a complete implementation probably just managing mailboxes isn't kind of standard yet
<RX14> they're a bit more restricted in how they're created I think
<FromGitter> <andreaTP> Even in Erlang
soveran has quit [Remote host closed the connection]
<RX14> so that they can be placed around a cluster
<FromGitter> <andreaTP> The abstraction will take care about distribution
<Papierkorb> What magic do they do to know if it's actually worth sending the actor off to some other machine?
<FromGitter> <andreaTP> It is usually explicit, Akka cluster is an extension to the base system that hides this to the user
<FromGitter> <andreaTP> But the basic ideas are simply three spawn new actors (usually intended like you do with object creation I mean without care about 'how many')
<FromGitter> <andreaTP> Pass messages to other actors
<FromGitter> <andreaTP> And let actors change their behavior
<FromGitter> <andreaTP> That could be covered with what already is in the language I think
<RX14> well actors are objects in akka aren't they?
<RX14> whereas in crystal they're basically arbitrary code with a start and end point
<FromGitter> <andreaTP> Hard to answer :-) properly I mean
<RX14> you can't send a message to a fiber in crystal
<FromGitter> <andreaTP> Actor is the original object oriented model
<RX14> you could use a channel to send a message and recieve it in the fiber
<FromGitter> <andreaTP> CSP can handle communication and fill queues right?
<RX14> communication in CSP is basically channels
<RX14> you have unbuffered and buffered channels
<RX14> and you can send objects down channels
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter> <andreaTP> Right so you can use channels to fill mailboxes and fibers to schedule execution of concurrent behaviors of actors
<RX14> i'm not quite sure what mailboxes are
<FromGitter> <andreaTP> Queues
<RX14> oh yeah that would be like a buffered queue
bjz has joined #crystal-lang
<FromGitter> <andreaTP> Yup
<RX14> in erlang is there one mailbox per actor? can they be created by themselves?
<FromGitter> <andreaTP> Yes one mailbox per actor
<RX14> interesting
<RX14> erlang sounds more restrictive compared to CSP
<RX14> however that's probably what allows it to do all it's cluster fanciness
<FromGitter> <andreaTP> No distinction between mailbox and actor itself since it is a "property" of the actor
<RX14> interesting
<FromGitter> <andreaTP> What really differs is that you do not have concurrently access to memory
<FromGitter> <andreaTP> That is kind of limiting in some sense
<FromGitter> <andreaTP> But result in much more reliable and easy to develop/debug software
<FromGitter> <andreaTP> And this is why Elixir is going so far :-)
<FromGitter> <andreaTP> Anyhow I really hope to find time to be around and poke about implementing Actors in Crystal
<RX14> yeah
<RX14> sometimes restrictions make for better software
<RX14> however crystal is a lot more general purpuse than erlang I think
<RX14> you wouldn't really make a desktop application in erlang
<FromGitter> <andreaTP> What do you mean?
<FromGitter> <andreaTP> Fair enough :-)
<RX14> they're different languages
bjz has quit [Quit: Textual IRC Client: www.textualapp.com]
<RX14> although erlang's usecase is pretty common to be fair
<FromGitter> <andreaTP> I will say they have different runtime :-)
pawnbox has quit [Remote host closed the connection]
<FromGitter> <andreaTP> Beam is great for distribution
<FromGitter> <andreaTP> And LLVM is great for generating assembly
<FromGitter> <drosehn> fwiw: I also use crystal for *non*-web development. I don't do any web development at all (not in any language).
<FromGitter> <andreaTP> So, if I could ask, what is the main purpose why Crystal have been created for?
<FromGitter> <drosehn> I have a chat server written in LambdaMOO, but that's been around for 20 years or so. I'd like to rewrite that (because almost no one knows the language), but if I did I'd probably try to do it in erlang or elixir.
<FromGitter> <andreaTP> Or at least the most common use case out there
<FromGitter> <drosehn> "faster ruby". :smile:
<RX14> well I wouldn't say that crystal was made specifically for a use case
<FromGitter> <andreaTP> No please
<RX14> but most of the current people who come over from ruby are web developers
<RX14> i would say that web devs are currently the largest portion of crystal's userbase
<FromGitter> <sdogruyol> that also what happened to Go
<FromGitter> <sdogruyol> started as a systems language wannabe
<RX14> however it's a lot more balanced for the actual crystal contributors I think
<RX14> yeah I don't think go is a particularly good web language myself
<FromGitter> <drosehn> A faster language is obviously better for deploying web apps, but that doesn't mean it's limited to web apps. I do notice that many crystal programmers are doing web apps, but there's nothing about crystal which makes it a problem for the projects that I want to use it for.
<FromGitter> <andreaTP> I do not think that changing code syntax is a problem nowadays....
<FromGitter> <sdogruyol> imho Crystal is suitable for more stuff
<FromGitter> <sdogruyol> needs more love though :P
<FromGitter> <andreaTP> :-)
<FromGitter> <sdogruyol> @andreaTP it's not the syntax but the best practices, knowledge e.g
<FromGitter> <andreaTP> Please elaborate @sdogruyol
<FromGitter> <andreaTP> Interesting
<FromGitter> <sdogruyol> @andreaTP well it takes time to get productive. For me (as a Rubyist) Crystal is productive from day 0
<FromGitter> <sdogruyol> isn't that a big win? (or just me)
<FromGitter> <andreaTP> To be honest I really REALLY liked Crystal because it looks like a reasonable language with good foundation choices
<FromGitter> <andreaTP> I come from a really different background and dynamic typing of Ruby always looks unsound
<FromGitter> <sdogruyol> @andreaTP yeah, it's really well thought from the ground up. Have you ever tried to read the Crystal compiler and std (it's also written in Crystal, IMHO it's awesome)
<FromGitter> <andreaTP> It's less than 48 hours that I'm involved :-)
<FromGitter> <andreaTP> I will :-)
<FromGitter> <sdogruyol> you'll feel at home :P
<RX14> I do prefer static typing to dynamic typing...
<FromGitter> <sdogruyol> i tried and failed every time i wanted to read C Ruby source :/
<RX14> every time I use dynamic languages i sort of feel dirty unless my specs are 4 times longer than themethod
<FromGitter> <sdogruyol> yet i really like reading Crystal source
<RX14> whereas in crystal I have a lot of confidence if the code just compiles
<FromGitter> <andreaTP> Probably documentation could be a bit better I'm learning faster from blog posts than from getting started to be honest
<RX14> docs are good for the language itself
<RX14> but the stdlib docs could use a lot of work
<RX14> the basic classes are documented really well but you do end up reading source sometimes
<FromGitter> <andreaTP> Structural types are not mentioned....
<FromGitter> <andreaTP> This IS a problem IMO
<RX14> but structural types don't exist
<RX14> any structual typing in crystal is simply a byproduct of the type system and type inference as a whole
bjz has joined #crystal-lang
<FromGitter> <andreaTP> They are in practice
<FromGitter> <sdogruyol> @andreaTP can you give an example?
<FromGitter> <andreaTP> Ugh not from the phone right now @RX14 yesterday link me a blog post that explains the concept well
<FromGitter> <andreaTP> Sorry @sdogruyol
<FromGitter> <andreaTP> And moreover please add static typing to bullet points :-)
bjz has quit [Client Quit]
<RX14> it's on the front page of crystal-lang.org ...
<FromGitter> <andreaTP> I miss Ecoop talk on Crystal 2 years ago because of that :-)
<FromGitter> <andreaTP> Ugh yes , my bad @RX14
<FromGitter> <andreaTP> Anyhow really pleasant to speak here around with you thanks!
<FromGitter> <andreaTP> Could I ask right now how is the situation of Crystal itself development? How many people involved, if any payed for etc. etc.
<RX14> it's essentially @asterite's project
<RX14> well
<RX14> originally
<RX14> and his employer manastech funds crystal development a bit I think
<FromGitter> <drosehn> note the link to bountysource on crystal's home page https://crystal-lang.org
<RX14> and there's donations from other companies
<travis-ci> crystal-lang/crystal#858c600 (master - Allow Time::Span to be divided by Time::Span): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/185853972
<RX14> there's quite a few contributors these days
<FromGitter> <drosehn> https://salt.bountysource.com/teams/crystal-lang -- shows that it's getting somewhere around $2000/month from various supporters.
<FromGitter> <andreaTP> Is @asterite still around or is more a community effort now?
<RX14> oh yeah @asterite is still around lol
<FromGitter> <andreaTP> Wow it's a kind of salary :-)
<FromGitter> <andreaTP> Wow yes :-)
<FromGitter> <andreaTP> Thanks a lot guys, really great support on newcomers
<RX14> not a problem
<FromGitter> <andreaTP> Really appreciated
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5ca344e (master - Add :nodoc: to Class#crystal_instance_type_id): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/185854044
soveran has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<travis-ci> crystal-lang/crystal#aafdafb (master - Fix argument notation in docs): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/185854331
dhk has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
akwiatkowski has joined #crystal-lang
dhk has quit [Quit: Leaving]
Philpax has quit [Ping timeout: 248 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
mgarciaisaia has quit [Quit: Leaving.]
<crystal-gh> [crystal] ysbaddaden opened pull request #3750: Sockets refactor: allow any family/type/protocol association (master...std-sockets-refactor) https://github.com/crystal-lang/crystal/pull/3750