ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.3 | 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
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 260 seconds]
Ven has quit [Ping timeout: 246 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
DTZUZU has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
Ven has quit [Ping timeout: 264 seconds]
Philpax has quit [Ping timeout: 264 seconds]
willl has joined #crystal-lang
Ven has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #3813: Support LLVM 4 (master...core-llvm-4.0) https://github.com/crystal-lang/crystal/pull/3813
Ven has quit [Ping timeout: 246 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] MakeNowJust opened pull request #3814: Avoid allocation in Iterator#with_index(&block) (master...fix/iterator/with-index-no-allocation) https://git.io/vMtDP
<DeBot> https://github.com/crystal-lang/crystal/pull/3814 (Avoid allocation in Iterator#with_index(&block))
DTZUZU has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
DTZUZU has quit [Ping timeout: 260 seconds]
DTZUZU2 has joined #crystal-lang
Ven has joined #crystal-lang
bjz has joined #crystal-lang
Ven has quit [Ping timeout: 265 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #3815: Fix each* methods to return self (master...fix/each-return-self) https://github.com/crystal-lang/crystal/pull/3815
<DeBot> https://github.com/crystal-lang/crystal/pull/3815 (Fix each* methods to return self)
Ven has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 248 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
Ven has joined #crystal-lang
chamar has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Ven has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
Philpax has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
Ven has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 246 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 268 seconds]
Ven has quit [Ping timeout: 264 seconds]
vivus-ignis has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
DTZUZU2 has quit [Read error: Connection reset by peer]
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
triangles2 has quit [Quit: Leaving]
Ven has joined #crystal-lang
mahlgrimm has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Ven has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
Raimondii has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 268 seconds]
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
pawnbox has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 256 seconds]
Ven has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
DTZUZU2 has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
bjz_ has quit [Ping timeout: 256 seconds]
bjz has joined #crystal-lang
vivus-ignis has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 245 seconds]
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
Ven has quit [Ping timeout: 259 seconds]
soveran has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
soveran has quit [Remote host closed the connection]
mahlgrimm has quit [Quit: mahlgrimm]
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
DTZUZU2 has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] ysbaddaden opened pull request #3818: Fix: SO_REUSEPORT may not be supported by the OS (master...fix/sockets-so-reuseport-may-not-be-supported) https://git.io/vMtxL
<DeBot> https://github.com/crystal-lang/crystal/pull/3818 (Fix: SO_REUSEPORT may not be supported by the OS)
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
ishahnaz has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden closed pull request #3818: Fix: SO_REUSEPORT may not be supported by the OS (master...fix/sockets-so-reuseport-may-not-be-supported) https://git.io/vMtxL
<DeBot> https://github.com/crystal-lang/crystal/pull/3818 (Fix: SO_REUSEPORT may not be supported by the OS)
<travis-ci> crystal-lang/crystal#619c02c (master - Fix: SO_REUSEPORT may not be supported by the OS (#3818)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/188044661
<DeBot> https://github.com/crystal-lang/crystal/pull/3818 (Fix: SO_REUSEPORT may not be supported by the OS)
soveran has quit [Remote host closed the connection]
DTZUZU2 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<FromGitter> <hdogan> hello, new to crystal here. i'd like to know how to limit and determine timeouts for `Process.run`.
<RX14> i don't think there is a timeout option for process.run
<RX14> you would have to do Process.new and manually wait for completion
<splitty_> hdogan, you could probably spawn the process, then wait for the specified timeout while querying .terminated, and then killing the process if it's still alive
<RX14> yup
<RX14> there's an internal Channel used for waiting... Eventually we can implement select_action for that
<RX14> and do select; when process.wait; when timeout.seconds; process.kill; end;
<RX14> but not yet
<FromGitter> <hdogan> i've tried STDOUT.write_timeout and put STDOUT as an output option but it does not work :/
<RX14> as I said you'll have to use Process.new and use a sleep loop
<FromGitter> <hdogan> i'll try that.
vivus-ignis has quit [Ping timeout: 258 seconds]
vivus-ignis has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
Ven has quit [Ping timeout: 246 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
ishahnaz has quit []
Ven has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Ven has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
soveran has quit [Remote host closed the connection]
Ven has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Ven has joined #crystal-lang
Ven_ has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
soveran has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @hdogan welcome :)
soveran has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<FromGitter> <maiha_twitter> question: `Proc` can't accept subclass? ⏎ https://carc.in/#/r/1iq3
<RX14> you should be able to use .as() to fix that
<FromGitter> <maiha_twitter> yup, thanks!
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
Raimondi has quit [Read error: Connection reset by peer]
DTZUZU2 has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
DTZUZU2 has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @jots_twitter that's still not possible in Crystal
<FromGitter> <sdogruyol> @jots_twitter https://github.com/crystal-lang/crystal/pull/1722
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
mahlgrimm has joined #crystal-lang
bjz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Client Quit]
<splitty_> Is it possible to pass a struct by reference?
<splitty_> Ah nevermind I can use a Pointer
Ven_ has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
soveran has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
<Papierkorb> splitty_: Check if a class wouldn't be more appropriate then
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Read error: Connection reset by peer]
<splitty_> Papierkorb, can't use a class in that situation, because I'm working with a C struct
<splitty_> But I fixed it, just used a pointer
<Papierkorb> To easy usage ^
<Papierkorb> *ease
<splitty_> Sweet! Thanks :)
<splitty_> Papierkorb, what's the license for your snippet?
<splitty_> RX14, Papierkorb, I'm having an issue where 32 bits of an unsigned 64-bit integer are truncated and I don't understand why
<Papierkorb> splitty_: MIT, updated the gist, please F5. It's from my not-published Kernel-in-Crystal project
<Papierkorb> splitty_: Please show us your struct, including the `lib` part
<splitty_> Papierkorb, this is just a problem with integer printing, not with the struct I mentioned earlier
<Papierkorb> splitty_: Please use a gist or any other pasting site
<RX14> splitty_, can you give a complete example?
<RX14> preferably which runs on carc.in or sth
<splitty_> RX14, change Terminal.write_byte to print and it should work :D
<splitty_> The thing is
<splitty_> I think this might be caused by the .to_u
<splitty_> Which probably truncates the integer to 32 bits
<Papierkorb> Yes, but you don't need it if you do your sign check before it
<splitty_> Papierkorb, I'm getting an error that / and % isn't implemented for UInt64 then
<Papierkorb> splitty_: you forgot to copy the definition for them.
<splitty_> I implemented it for Int using unsafe_div and unsafe_mod
<splitty_> Do I really have to do this for every possible type?
<RX14> yes
<RX14> it's not the to_u
<RX14> i think it's a bad array reverse
<Papierkorb> splitty_: yes you have to. don't have the code for it anymore, I got it to compile with the distributed Int implementation of Crystal
RandyN has joined #crystal-lang
<splitty_> RX14, I took the array reverse from the K&R implementation used in the C standard library for atoi
<RX14> well
<RX14> it's closer
<RX14> albeit wrong
<RX14> before the reverse
<RX14> splitty_, i know why
<RX14> oh no
<RX14> hmm
<RX14> splitty_, https://carc.in/#/r/1iqi
<RX14> i added .chr to the `print arr[i]`
<splitty_> RX14, I didn't have to do that in my code because Terminal.print_byte accepts a byte
<RX14> are you sure
<RX14> because
<RX14> that's correct
<RX14> it's working
<splitty_> Yep, it's working. For the last 32 bits. :P
<splitty_> Of course in this example it's also working for larger version
<splitty_> But in my minimal runtime this doesn't seem to be working
<RX14> so does print(32) work for you?
<splitty_> Yes
<RX14> ok
<RX14> well
<RX14> i don't know
RandyN has quit [Quit: Page closed]
<Papierkorb> worked with any Int for me
<splitty_> I just have problems with the value % base and value / base part
<splitty_> Getting linking errors
<splitty_> src/kernel.o: In function `*Int32@Int#%<UInt64>:Int32':
<splitty_> main_module:(.text+0x31b3): undefined reference to `__moddi3'
<RX14> maybe you implemented % wrong
<RX14> probably not then
dbohdan has joined #crystal-lang
<dbohdan> Is being able to produce shared objects a goal for Crystal 1.0?
<RX14> no
<RX14> crysdtal is made to have a runtime
<RX14> ok that was a rubbish answer
<dbohdan> I see there's an RFC at https://github.com/crystal-lang/crystal/issues/921
<RX14> dbohdan, crystal libraries won't be distributed as shared objects because the way the current type system works means it requires the source
<RX14> you can currently technically make shared objects
<RX14> but it's really fiddly
<RX14> as you need to iunitialize the crystal runtime manually
<RX14> it's all a bit of a pain
<Papierkorb> dbohdan: what's your use-case? Using crystal SO's in non-crystal programs?
<dbohdan> Papierkorb: Yes. I'm looking for agreeable language to write extend the Tcl interpreter in.
<dbohdan> *languages
<splitty_> Papierkorb, did you use this int implementation?
<dbohdan> Darn correction, but you got me.
<Papierkorb> splitty_: Yes, at some point I was able to use a surprising amount of the standard sources
<splitty_> String interpolation is my enemy at the moment
<Papierkorb> That I didn't have and am fine with :P
<Papierkorb> Cause then you need the GC
<RX14> you don't need a GC for string interp
<RX14> well not technically
<Papierkorb> No, but then no one would free the string again
<RX14> you could?
<Papierkorb> I could also use C at that point
<splitty_> ^
<Papierkorb> Or Rust
<Papierkorb> One of the reasons I chose to cease working on my OS-in-Crystal project btw
<Papierkorb> Or rather, *Kernel-in-Crystal
<splitty_> Papierkorb, I'm pretty sure you can make automatic free-ing work with Rust pretty easily
<splitty_> Just implement Drop
<Papierkorb> Rust? Yes, the compiler does it, they don't have a GC
<Papierkorb> Don't need one
<splitty_> Yeah
soveran has quit [Remote host closed the connection]
<dbohdan> I have to say that at least for writing standalone command line utilities and daemons Crystal looks really good.
<crystal-gh> [crystal] asterite pushed 10 new commits to master: https://github.com/crystal-lang/crystal/compare/619c02cb46c9...5739844f69cf
<crystal-gh> crystal/master ecab85c Ary Borenszweig: HTTP::Client: reconnect when server closes connection
<crystal-gh> crystal/master fd57037 Ary Borenszweig: Let `XML::Node#content` return an empty string when no content is available....
<crystal-gh> crystal/master 64c991b Ary Borenszweig: Fixed `XML::Node#[]` to always return String
<Papierkorb> dbohdan: My experience with Crystal makes me agree :)
<dbohdan> It's nice to see more languages compete in this space.
<Papierkorb> dbohdan: Networking stuff (with some corner cases, which will probably be resolved in 1.0) is decent
dhk has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
bjz has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5739844 (master - XML: a few refactors in XML::Builder): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/188114533
vivus-ignis has quit [Ping timeout: 265 seconds]
<dbohdan> Papierkorb: Are there any major corner cases at this point?
mahlgrimm has quit [Quit: mahlgrimm]
<RX14> i can't think of any off the top of my head
<Papierkorb> dbohdan: TL;DR: 1) No real (usable) threading 2) Effective max count of concurrent fibers is 32k 3) You can't `select` on an IO yet (RX14 was working on this though) 4) Same pros and cons as Go-langs "threading" model afaik 5) Of course, APIs may not be stable yet 6) stdlib docs is sometimes lacking, forcing you to read (Crystal) code 7) There's not yet a shard for everything (like there is a gem for almost everything in ruby)
<Papierkorb> dbohdan: Nothing that should prevent you from having a look, and nothing that should be a surprise given Crystal is a Alpha/Beta state language
Ven has joined #crystal-lang
<RX14> well the only "concurreny corner case" out of that is the effective concurrent fibers count imho
<RX14> but yes those are pretty much the cons of crystal with a focus on cuncurrency and IO
<Papierkorb> dbohdan: However, some of the pros of Crystal imho are: 1) It's somewhat near Ruby, if you like Ruby, you'll like Crystal 2) Type system 3) it's surprisingly fast tbh
<dbohdan> Papierkorb: Thanks! That's a really helpful answer.
<crystal-gh> [crystal] maiha opened pull request #3820: Fixed example codes (semantics) (master...fix-examples-semantics) https://github.com/crystal-lang/crystal/pull/3820
<Papierkorb> dbohdan: For example, I've written a BitTorrent shard, which if you only compare CPU load, easily outperforms KTorrent (Using a third of the CPU load in fact). Take it with a grain of salt, my code is not as mature as KTorrents, neither do I draw a GUI. Still, I would lie if I'd say I wasn't somewhat impressed
<DeBot> https://github.com/crystal-lang/crystal/pull/3820 (Fixed example codes (semantics))
<dbohdan> The funny thing is, I've never been much of a Ruby user outside Vagrantfiles and the occasional shell script but now two of the languages I'm most interested in are influenced by Ruby. :-)
<Papierkorb> dbohdan: Also please note that you can use Crystal perfectly fine for non-web-development things. In fact, I didn't write a single web service in it yet.
Ven has quit [Ping timeout: 258 seconds]
<BlaXpirit> neither did i :)
<RX14> dbohdan, whgich is the other lang influenced by ruby?
<dbohdan> RX14: Elixir.
<RX14> oh yes
<RX14> elixir feels a lot less ruby to me
<Papierkorb> Just wanted to point that out, as many think that Ruby and Crystal are "web dev only" languages. (I never got what that's supposed to mean either)
<RX14> yeah if anything crystal is most optimized for writing compilers
<RX14> :)
<Papierkorb> haha
<Papierkorb> Yeah and it's LLVM bindings are really good too :P
<Papierkorb> *its
<Papierkorb> Oh and I forgot to mention that interfacing with C libraries is pretty good in general dbohdan. Writing wrappers is really easy IMO, and there's more to come for this too
<dbohdan> I'm very biased here, but if you're looking for a simple C API to add a GUI to your BitTorrent client, try Tcl/Tk's.
<RX14> well libui has cryatal bindings
<RX14> i'm not sure how they compare
<RX14> but thats another option
<dbohdan> Modern Tk will look pretty good on Windows/macOS and not entirely horrific on Linux.
<Papierkorb> it's a library and not meant to be used on its own (Oh right, I have to ask the awesome-crystal maintainer to move it into the network section too), but having a solid UI shard would be much appreciated dbohdan
<dbohdan> If I get deeper into Crystal, I might write the bindings. As I said, having a language that isn't C to interact with the Tcl interpreter is a major reason I'm looking at Crystal.
<RX14> the libui shard even has a yaml format for describing interfaces aparrently
<RX14> so its had quite a bit of work
<Papierkorb> dbohdan: Do you want to embed tcl or embed crystal into tcl?
<dbohdan> Both, but embedding non-C in Tcl is more interesting to me.
<dbohdan> If I have the time, I'll see if I can do it in a reasonable manner with a C shim.
<Papierkorb> Well, Crystal requires libgc (boehm gc) and libevent2 (most likely) among other libs. The first one requires set up by you (at least, calling crystals setup functionality for it), the second may or may not play ball with tcl
<Papierkorb> The other libs, like libpcre, shouldn't make much trouble though
<Papierkorb> Also I don't know if boehmgc likes being used in a library only, not that it starts running around breaking the host process :)
<dbohdan> I think I've actually tried replacing malloc/free with libgc in a Tcl extension once and it seemed to work. I wonder about how libevent2 will interact with Tcl's own event system.
vivus-ignis has joined #crystal-lang
<RX14> if it doesn't workm you can avoid the scheduler pretty easilly
<Papierkorb> Also, the compiler will not let you build shared libs by itself. Instead, pass `--cross-compile` to the `crystal build` command, and link the resulting .o yourself. The compiler will tell you the `gcc` link invocation it would've used, so you can adapt it easily
<Papierkorb> dbohdan: Oh, and fibers may or may not work. In the end, they're stack pointer magic, so it could, but may conflict with the tcl interpret
<dbohdan> I'll remember to pass '--cross-compile'.
<dbohdan> As for the stack magic, what would be a good way to debug it if it doesn't work out of the box?
<RX14> well, if it segfaults when you use IO, set blocking = true on the IO is pretty much the best bet
<dbohdan> Noted, but I mean more if there is a build option to make the code run in some sort of a scheduler debug mode or something like that.
<RX14> no
dhk has quit [Quit: Leaving]
<dbohdan> Got it.
<dbohdan> As for web dev, that's what I'm primarily learning Elixir and the OTP for.
<RX14> yeah crystal needs more work in web dev
<RX14> i wouldn't say it's a particularly good web dev lang even
<Papierkorb> FTFY „yeah crystal needs more work“
<RX14> i'd much rather be pushing something machine-readable out of crystal than HTML
<dbohdan> It's something of a truism that the Erlang VM, BEAM, is too slow for computation-heavy code. (About as slow as Ruby, Python, Tcl, Perl and the rest. Sometimes better and sometimes worse than each of them.)
<Papierkorb> RX14: Same
<dbohdan> Crystal could once again be useful a non-C language in which to talk to BEAM.
<RX14> ECR is sort of a pain
<RX14> slang sort of works
<RX14> but it's buggy and not really cared about
<RX14> neither does it seem to learn any lessons from jade
<Papierkorb> I need a HAML dialect and basically Roda to even consider using Crystal
<dbohdan> *useful as a
<RX14> which i consider to be far superior to slim
<Papierkorb> But as I don't want to build neither, ... ;)
<Papierkorb> *either
<RX14> jade is like slim but with templates and partials built in
<RX14> so you don't haver any of the yield hacks
<RX14> which become much more of a problem when you're codegenning at compile time
<RX14> i have so many crystal projects I want to do
<RX14> but no time
<RX14> too busy procrastinating
<Papierkorb> RX14: well you can cache the generated ruby code
<Papierkorb> Which I was amazed to find out that it was not done from the start
<RX14> ??
<Papierkorb> From haml, etc. Then it still does yield of course, but it's less expensive
<RX14> yes but the problem is not the speed
<RX14> it's the ugliness
<RX14> jade just seems to be a cleaned up slim
<RX14> and i love it
<dbohdan> Could you embed a Ruby interpreter in your Crystal application for the HTML templating?
<Papierkorb> Technically, yes
<RX14> probably but I don't think I would
<Papierkorb> Though mruby would be better, MRI uses globals etc.
<RX14> yeha it would be mruby
<Papierkorb> In practice, I would neither
<dbohdan> Is mruby thread safe? I recall reading it wasn't.
<RX14> just careate one per thread then
<RX14> or something
<Papierkorb> If templating is the only use-case, maybe Lua or so
<RX14> thread-local vars exist in crystal
<RX14> i would just make my own interpreter
<RX14> have stuff be passed to the template as a hash or named tuple or sth
<dbohdan> "One thing I care about is thread safety. I need to run multiple mruby instances, each in a thread, and there will be no interaction across threads. If mruby cannot support this use case then I’ll have to use other solutions. Luckily, the code base of mruby is not big, so I checked all of its source code. There is only a few static non-const variables, which is only used for GC statistics. So I can
<dbohdan> confidently use mruby in a multi-thread environment!" http://www.yzhang.net/blog/2014-06-22-mruby-embed-thread-safety.html
<RX14> or whatever is the most efficient
<RX14> and then make the template be able to access that
<dbohdan> I guess it can be done with mruby.
<RX14> i'd still make my own minimal expression language
<RX14> wouldn't even really be turing complete probably
<RX14> well not for a single expression
<RX14> the template itself would be
bjz has quit [Ping timeout: 245 seconds]
<dbohdan> I'll try using Crystal with Elixir first because the standard practice in Erlang-land is to start an external process and talk to it over its stdin/stdout rather than load a shared library.
<dbohdan> Thanks for answering my questions!
<dbohdan> Bye.
<RX14> bye
bjz has joined #crystal-lang