ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei__ has quit [Ping timeout: 276 seconds]
meltingwax has left #crystal-lang [#crystal-lang]
<FromGitter> <girng> :alient
<FromGitter> <girng> 👽
<FromGitter> <Blacksmoke16> i saw that
<FromGitter> <girng> xD
duane has quit [Ping timeout: 245 seconds]
snsei__ has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
_whitelogger has joined #crystal-lang
duane has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei__ has quit [Ping timeout: 252 seconds]
<FromGitter> <watzon> Damn IPv6 networks are huge
<FromGitter> <watzon> UInt128 support would be nice right about now. I'm having to use BigInt to handle IPv6 networks
laaron has joined #crystal-lang
mistergibson has left #crystal-lang [#crystal-lang]
<FromGitter> <watzon> If anyone can think of a cleaner way to do this I'd love to hear it https://github.com/watzon/subnet/blob/master/src/subnet/ipv6.cr#L702
<FromGitter> <watzon> It's easier in ruby because you can do `break if str.sub!` with all the items because `sub!` returns `nil` if nothing was substituted
snsei_ has quit [Remote host closed the connection]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<rkeene> watzon, What does it do if someone does f00:00:00::1 ? :-D
<FromGitter> <watzon> I don't think the output would change in that case
<rkeene> The canonical collapsed representation would be f00::1
<rkeene> Oh, I missed the mapjoin at the top, it takes in an array of its parts
<FromGitter> <watzon> Ahh yeah that is the output
<FromGitter> <watzon> Just checked
<rkeene> Hmm, seems like it might get some cases wrong
<rkeene> f:0:0:1:0:0:0:1 -> ?
<FromGitter> <watzon> f:0:0:1::1
<FromGitter> <watzon> Or 000f:0000:0000:0001:0000:0000:0000:0001/128 for the full address
<FromGitter> <watzon> Is there a good way to check if an address is a link local address?
<rkeene> Get the first 10 bits and see if they are 0x3FA ?
<FromGitter> <watzon> According to https://tools.ietf.org/html/rfc4291#section-2.5.6 the first 10 bits have to be `0xfe80` and the next 54 bits have to be 0, but according to https://tools.ietf.org/html/rfc4862#section-5.3 any address with the prefix `fe80::/10` is a valid link local address
<rkeene> 0xfe80 is more than 10 bits
<FromGitter> <watzon> I was just wondering if you knew of an online tool that could tell me if I'm doing things right
<FromGitter> <watzon> Whoops
<rkeene> 0x3FF is the largest 10 bit number
<FromGitter> <watzon> I mean starting with 0xfe80
<FromGitter> <watzon> but yes
<FromGitter> <watzon> you're right
<FromGitter> <watzon> Right now my tests are telling me that `fe80::/63` is a valid link local address, but the library that I'm referencing (https://github.com/ipaddress-gem/ipaddress/blob/master/test/ipaddress/ipv6_test.rb#L58) says otherwise
<rkeene> Also, with link local you'll have zone IDs added, so there's more syntax to be aware of
duane has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <watzon> Wrapper methods like this aren't possible in Crystal right? https://github.com/ipaddress-gem/ipaddress/blob/master/lib/ipaddress.rb#L276
blassin2 has quit [Quit: Ping timeout (120 seconds)]
blassin2 has joined #crystal-lang
Yxhuvud has joined #crystal-lang
<FromGitter> <watzon> Lots of docs to write https://github.com/watzon/subnet
rohitpaulk has quit [Ping timeout: 244 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Oo
<FromGitter> <bararchy> @watzon do you even sleep? XD
<FromGitter> <watzon> Nope
<FromGitter> <watzon> Lol
<FromGitter> <watzon> To the chagrin of my wife
<FromGitter> <bararchy> HAHAHA
<FromGitter> <watzon> But hey, the Crystal community is getting some good shards out of it
<FromGitter> <watzon> :p
<FromGitter> <bararchy> that's true, very helpful stuff TBH
<FromGitter> <watzon> I'm mainly trying to fill gaps in the ecosystem. I know a language nowadays is only as good as it's ecosystem and I very much want Crystal to succeed
<mps> watzon: agree fully
<mps> I looked at some of your shards. Although I don't use them (yet) I like to have them in my 'back brain' to remember when time come I need them. thanks for your work
<FromGitter> <watzon> No problem :) honestly I love just love contributing and creating things that are useful to people
<FromGitter> <bararchy> @watzon How about a 0mq or rabbitMQ ? ;)
<FromGitter> <watzon> Hmm I've never used either, but I could definitely have a look
<FromGitter> <watzon> I *definitely* don't have too many projects
<FromGitter> <watzon> Lol
<FromGitter> <watzon> Ooh 0mq actually seems really cool
<mps> when talks is about MQ's, are there mqtt shard somewhere
rohitpaulk has quit [Ping timeout: 268 seconds]
sorcus has joined #crystal-lang
<FromGitter> <bararchy> hmmmm https://github.com/liu-chong/mqtt_crystal
<mps> ah, thanks, will try to build client for Alpine Linux mqtt service
<jokke> watzon: yeah i wrote a client lib for 0mq but it's not really nice to use from crystal
<FromGitter> <watzon> Why is that?
<jokke> because it doesn't use event based io
<jokke> the c lib i mean
<FromGitter> <watzon> Ahh I gotcha
<FromGitter> <bararchy> ohhh this one is nice: https://github.com/askn/faker
<jokke> but i like the concept of zmq
<FromGitter> <watzon> Yeah I've been using that with Lucky for generating mock data
<jokke> watzon: nats is also really cool
<jokke> but more like mqtt
<jokke> needs a broker
<FromGitter> <watzon> Never head of nats
<jokke> also started writing a client lib for it: https://github.com/repomaa/nats.cr
<jokke> but no docs, no nothing yet
<jokke> watzon: https://nats.io/
<FromGitter> <watzon> Well I'll check back in once you've documented it a bit ;)
<jokke> heh :D
<FromGitter> <watzon> I mean I don't expect docs like what I'm writing for https://github.com/watzon/subnet
<FromGitter> <watzon> But you know
<jokke> yeah sure ;)
<jokke> i'm one of those people that write stuff to write other stuff to write other stuff. "ok, works for me, moving on"
<FromGitter> <watzon> Lol I suppose that's the good thing about open source, if you don't do it someone else always can
<jokke> the documentation? :D
<FromGitter> <watzon> Yup, or anything else for that matter
<jokke> hah i wouldn't expect anyone to do that :D
<jokke> docs are always the tedious part
<jokke> and you already know how it works since you wrote it!
<jokke> :D
<FromGitter> <watzon> Haha I'm different than most people in that regard. I do DDD (documentation driven development) most of the time, so I typically work backwards, writing docs for features that don't exist yet and then implementing those features. It helps me thing about things from the user's point of view.
<jokke> oh that's a good method!
<jokke> gotta try that sometimes
<FromGitter> <watzon> And the docs are complete (https://github.com/watzon/subnet)
<FromGitter> <watzon> Holy shit that was a lot
<FromGitter> <j8r> you should also use structs, an IP is supposed to be immutable
<FromGitter> <watzon> Good point, I'll look into refactoring that
rohitpaulk has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <bararchy> Found a cool bug :) https://github.com/crystal-lang/crystal/issues/7945
<FromGitter> <bararchy> I guess it's related to trying to read an IO after the client already closed it
sagax has quit [Ping timeout: 268 seconds]
duane has joined #crystal-lang
<FromGitter> <spTorin> Exist any way to make analog PING to host in Crystal? Check host alive.
rohitpaulk has joined #crystal-lang
<jokke> any idea what's happening here on alpine? https://p.jokke.space/C4T51/
<sorcus> @spTorin Call `ping host`? :-D
<jokke> ah
<jokke> ok so no solution yet but should work with alpine 3.9
<jokke> hm nope, not working with 3.9 either
<jokke> but i'm installing crystal from edge repos
<FromGitter> <mwlang> I'm having trouble rendering code examples in the README.md file. Works fine for when github.com shows the readme, but with crystal docs, content is lost along the way.
<FromGitter> <mwlang> vs what you'll see here: https://github.com/mwlang/binance#rest-client
<jokke> lol cloudshare is down
<FromGitter> <mwlang> any idea what's happening here?
<jokke> bye internet
<jokke> always sounded like such a good idea to put everything behind a single centralized solution!
<FromGitter> <mwlang> I thought you said cloudflare for a moment...
<jokke> oh
<jokke> i meant cloudflare
<jokke> lol
<FromGitter> <mwlang> and sadly, my sites are down. :-(
<jokke> yeah...
<jokke> well...
<FromGitter> <mwlang> but yeah, I always worried about this day.
<jokke> why..?
<FromGitter> <mwlang> well, they do make it easy to mitigate DDoS attacks.
<jokke> just make a static site :P
<jokke> and how many ddos attacks have your sites received before cloudflare?
<FromGitter> <mwlang> and my bigger customers have been big targets of DDoS over last few years.
<jokke> oh ok for customers
<FromGitter> <mwlang> me personally, none. I just have mine on cloudflare for testing.
<FromGitter> <mwlang> but my customers...they get absolutely hammered at times.
<jokke> hehe
<FromGitter> <mwlang> and I reckon I better go check in on them and let 'em know what's up!
<jokke> i get hammered some times too
<jokke> on weekends
<FromGitter> <mwlang> I'm guessing some devop fat thumbed a configuration setting somewhere...akin to Amazon's crash last year.
<jokke> mmh
<FromGitter> <mwlang> Let's find out which crypto-exchange has been hacked because pretty much all of them hide behind cloudflare.
<jokke> :D
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <spTorin> @mwlang in your example ping is just get REST API from node
<FromGitter> <mwlang> @spTorin actually, I need to update that example now that I look at it closely. Some of this copied from Ruby gem examples, which have obviously changed!
<FromGitter> <mwlang> I was caught up in "why it's not rendering the docs" and not looking at what's written.
<FromGitter> <mwlang> uhm...how do you write examples that work? In my case, I created an ./examples folder and the first example script there, ./examples/ping.cr: ⏎ ⏎ ```require "../src/binance" ⏎ ⏎ client = Binance::REST.new ⏎ puts client.ping.inspect``` ⏎ ⏎ And that leads to not being able load dependencies! "/binance/src/binance.cr💯 can't find file 'cossack'" (which is in the project's shard.yml
<FromGitter> <mwlang> In Ruby, at runtime, I can add on dynamically to $LOAD_PATH. Is there something similar for Crystal?
<FromGitter> <mwlang> nothing documented here on modifying load paths: https://crystal-lang.org/reference/syntax_and_semantics/requiring_files.html
<FromGitter> <mwlang> based on comments made here: https://github.com/crystal-lang/shards/issues/165 I just symlinked ../lib to examples/lib and that worked, but sure feels hacky.
<FromGitter> <watzon> I've never had a problem running examples that are in the `/examples` folder. Are you running them from your projects root or cding into the examples directory to run them?
<FromGitter> <watzon> @mwlang ^
<FromGitter> <mwlang> I'm in the examples folder.
<FromGitter> <mwlang> but maybe it works better to do `crystal examples/ping.cr` instead of `cd examples && crystal ping.cr` ?
<FromGitter> <watzon> That's your problem
<FromGitter> <watzon> Exactly
<FromGitter> <watzon> Otherwise each example should be its own shard with a `shard.yml` file that requires your project
<FromGitter> <mwlang> hmmm...that didn't work either.
<FromGitter> <watzon> What is the error you're getting?
<FromGitter> <mwlang> ```crystal examples/ping.cr``` => Error in examples/ping.cr:1: while requiring "../src/binance" ... in src/binance.cr💯 can't find file 'cossack'
<FromGitter> <watzon> You've run `shards install` I'm assuming?
<FromGitter> <mwlang> yes.
<FromGitter> <mwlang> I have the ./lib/cossack folder.
<FromGitter> <mwlang> and specs work, of course.
<FromGitter> <watzon> Hmm, weird
<FromGitter> <mwlang> it's just that the examples aren't loading from the "../lib" folder.
<FromGitter> <mwlang> so my "hack" was to symlink ../lib as ./examples/lib
<FromGitter> <Blacksmoke16> are you sure you're paths are right?
<FromGitter> <watzon> See I'm doing the same thing here (https://github.com/watzon/tourmaline/tree/master/examples)
<FromGitter> <mwlang> and with that, it started finding the dependency shards.
<FromGitter> <Blacksmoke16> not going up an extra directory or something
<FromGitter> <mwlang> are you willing to give it a shot? https://github.com/mwlang/binance
<FromGitter> <mwlang> I don't see any difference in my code from yours and I see you also have at least one dependency shard for the project.
<FromGitter> <mwlang> for what it's worth, I don't have any globally (system level) shards installed if that's even possible...
<FromGitter> <watzon> It's not
<FromGitter> <watzon> I'll clone it and check it out real quick
<FromGitter> <watzon> Weird, it ran for me right away
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1b7bd12e3f4317635bcfa3]
<FromGitter> <mwlang> ok, that's just plain nuts
<FromGitter> <watzon> Since you have the code pushed maybe delete the directory and reclone
<FromGitter> <mwlang> I'm thinking same thing!
<FromGitter> <watzon> Then run `shards install` and try again
<FromGitter> <mwlang> I actually already deleted lib and reran shards install
<FromGitter> <mwlang> but that didn't solve it.
<FromGitter> <watzon> Idk what the problem could be. Let's see what happens with recloning, then we can check out other possibilities
<FromGitter> <mwlang> it works in the re-cloned folder.
<FromGitter> <watzon> Well there we go
<FromGitter> <watzon> Who knows wtf was wrong haha
<FromGitter> <mwlang> now I'm HIGHLY curious!
<FromGitter> <mwlang> deleted the shards.lock file
<FromGitter> <mwlang> then ```shards install``` and that made all the difference.
<FromGitter> <mwlang> so removing lib and ```shards install``` didn't solve, but the above does.
<FromGitter> <mwlang> since I deleted it, no idea what state it was in to compare.
<FromGitter> <mwlang> thanks for giving it a go. Definitely helped my sanity check there.
<FromGitter> <watzon> It's possible that the symlinking fucked things up
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <j8r> `rm -rf /` solves also any problem - no file, no OS, no more problem
<FromGitter> <watzon> 😂 so true
laaron has joined #crystal-lang
<FromGitter> <j8r> I've pushed an update to a compile-time safe CLI lib: https://github.com/j8r/clicr ⏎ What do you think? An issue I see is we can't dynamically modify the CLI at runtime, is there a usecase for this?
<FromGitter> <j8r> Usually everything that is dynamic are command arguments and variables, not subcommands
<FromGitter> <j8r> nor options
duane has quit [Ping timeout: 258 seconds]
duane has joined #crystal-lang
<FromGitter> <mwlang> uhmmm...symlinking came as a result of things being FU'd. ;-)
<FromGitter> <mwlang> I suspect it's because I tried a number of different shards along the way, modifying dependencies and development dependencies as I did so.
duane has quit [Ping timeout: 248 seconds]
<FromGitter> <mwlang> so, removing the .lock file and shards install solved whatever mess I had created there.
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/768v when doing a `with x yield x` how would you use method that are also keywords?
<FromGitter> <Blacksmoke16> or is that not possible...
<FromGitter> <mwlang> @j8r when did that command change!? It used to be ```"format C:" ``` 😆
<FromGitter> <mwlang> The sad thing is we used to give that command out to newbies coming onto BBS forums and asking dumb question, esp. after they curse the veterans out -- and more than a few were known to have follow it blindly.
<FromGitter> <mwlang> how to inline HTML for crystal docs to render as-is?
duane has joined #crystal-lang
<FromGitter> <Blacksmoke16> im assuming just putting html in the comment block doesnt work
<FromGitter> <mwlang> that's correct
<FromGitter> <pynixwang> how to pass c binding custom header
<FromGitter> <pynixwang> @[Include] is not there
absolutejam1 has joined #crystal-lang
<absolutejam1> anyone got a good resource (blog post or whatever) about Crystal's concurrency situation?
<absolutejam1> I'm not sure I caught it last time I checked on the language and I'm super interested in picking it up
<absolutejam1> I'm searching myself, but I'm just asking in case any body has posted something a thousand times to answer annoying questions (like this one)
<rkeene> I think it's currently just cooperative multithreading within a single logical thread of execution
<FromGitter> <mwlang> Just the main gitbook entry: https://crystal-lang.org/reference/guides/concurrency.html
<FromGitter> <watzon> rkeene has it right, there's currently no true multi-threading. Everything operates in a single thread with a stack of fibers.
<rkeene> And, it is significant to know, within a single execution space -- in some languages you can have different address spaces between threads (of any type), but Crystal is a shared address space for its threads, which can sometimes matter
<absolutejam1> that's what I just read, thanks. That's fine enough for my uses.
<absolutejam1> Honestly, it's more to help my feeble brain not have to use async
<FromGitter> <mwlang> this is an interesting read: https://news.ycombinator.com/item?id=15945262
<FromGitter> <watzon> Well async still exists, just not multithreaded async
<FromGitter> <watzon> In fact, I have found this (https://devdocs.io/crystal/api/0.27.0/toplevel#future(&exp:-%3E_)-class-method) to be extremely useful
<absolutejam1> does go do full parallelism via. goroutines, or just concurrency?
<FromGitter> <watzon> Pretty sure go has full parallelism support
<FromGitter> <watzon> As does rust
<absolutejam1> watzon: more just that i've never been able to handle it very well in most languages
<absolutejam1> Think it takes a bit of a mental shift and I've never needed it in that way, and I don't try and touch js, like ever.
<rkeene> Go supports pre-emptive multithreading, which -- on a system with multiple physical execution units -- can cause true concurrency
<rkeene> The larger advantage is that the user doesn't have to define yield points, which is also the larger disadvantage when using a shared adress space :-D
<absolutejam1> the reason I'm reaching for Crystal is because I'm writing a lot of Elixir and I'm kinda fed up of Python's rigidity. I've started writing a bit of Ruby instead of Python for those quick jobs and I love the syntax. I've tried go a few times but it's just too 'ugh' for what I need it for
<rkeene> A good paper on this is Events vs. Threads by Ousterhout if you're interested
<absolutejam1> I'll check it out
<FromGitter> <watzon> Yeah python pretty much sucks
<rkeene> If you're exploring stuff and want an interesting take on concurrency, I'd also recommend looking at Tcl for a more mature ecosystem. It's what I prefer for this kind of work, but Crystal has some other advantages.
<rkeene> An interesting paper I did on one way to do CSP (ala Go and bash) within Tcl's threads: http://www.rkeene.org/tmp/pipethread-presentation-withnotes.pdf
<absolutejam1> watzon: Python was great when I was learning it on the side because it has its fingers in every possible pie and it's quite easy to grok
<absolutejam1> but it's just not very expressive. like, at all
<FromGitter> <watzon> Yeah that's about the only good thing about it
<FromGitter> <watzon> Lol
<rkeene> Tcl does everything you could ever want, but nobody's ever heard of it :-D
<absolutejam1> Yeah, I'm trying to stay away from some of the lesser known or esoteric languages
<rkeene> (Or they have, but it's mostly misinformation -- see "Tcl The Misunderstood", http://antirez.com/articoli/tclmisunderstood.html)
<absolutejam1> ocaml looked hella interesting too, but Ruby-ish syntax is the most expressive I've found.
<rkeene> absolutejam1, Tcl isn't exactly esoteric, many projects started out as Tcl stuff and branched out from there -- Redis was originally a Tcl script, SQLite was originally a Tcl extension, for examples off the top of my head
<absolutejam1> the biggest problem I see is that go is still the standard for the likes of kubernetes, but I keep avoiding it as long as I can
<absolutejam1> rkeene: that's interesting; I never knew that
<FromGitter> <bew> @Blacksmoke16 https://play.crystal-lang.org/#/r/769e
<rkeene> SQLite is a "Tcl extension that escaped": https://www.tcl.tk/community/tcl2017/assets/talk93/Paper.html
<FromGitter> <watzon> Tbh I can't stand Go
<FromGitter> <watzon> They made a lot of weird choices in the design of it
<FromGitter> <Blacksmoke16> @bew perfect thanks :)
<FromGitter> <watzon> Especially concerning package management
<FromGitter> <bew> @Blacksmoke16 it's also how you call a setter when using with..yield
<FromGitter> <bew> ;)
<FromGitter> <Blacksmoke16> cleans up the tests quite well 😉
<FromGitter> <watzon> Is there any reason why Crystal should or should not have ASCII-8BIT encoding support like Ruby? https://idiosyncratic-ruby.com/56-us-ascii-8bit.html
<FromGitter> <watzon> It's not a real encoding format, but there are several gems that I've seen use it and I don't know if something similar is already possible in Crystal
<FromGitter> <watzon> Although I guess Crystal's strings are UTF-8 encoded only
<FromGitter> <mwlang> I wouldn't say nobody's heard of Tcl. ;-) It was, after all the forerunner of many other of today's script languages.
<rkeene> mwlang, Most people think it's no longer around even though it has gained features and become valuable for solving problems at a compounding rate
<FromGitter> <mwlang> I actually started my first foray into web development with Tcl reading http://philip.greenspun.com/panda/
<FromGitter> <mwlang> Well, that, I can believe...it's rarely mentioned in my social circles anymore...perhaps because I have more Ruby friends and that's more what we tend to talk about.
<FromGitter> <mwlang> but I also don't see much published about it on Medium and other outlets either.
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<absolutejam1> watzon: Jesus christ, just getting dependencies and importing is the hardest part
<absolutejam1> go modules made it a bit easier from my tinkering, but cmon
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <watzon> Yeah go's package management is a shit show
<FromGitter> <watzon> And with it's syntax you might as well be using C or D
<FromGitter> <mwlang> so, the comments in crystal's source say markdown was implemented to Daring Fireball's syntax/specs
<FromGitter> <mwlang> but going through the code, it really is very minimal markdown that's supported.
<FromGitter> <mwlang> and inline HTML is not one of 'em.
<FromGitter> <Blacksmoke16> `NOTE This library is in its early stage. Many features are still in development.`
<FromGitter> <mwlang> yeah, I saw that note too.
<FromGitter> <watzon> Yeah the markd shard is much more feature complete
<FromGitter> <watzon> https://github.com/icyleaf/markd
<FromGitter> <wontruefree> @watzon thanks for the subnet release
<FromGitter> <watzon> No problem. Should be pretty much feature complete, but let me know in the issues if there's anything specific it's missing
<FromGitter> <girng> hi
<FromGitter> <Blacksmoke16> o/
<FromGitter> <girng> LOL
<FromGitter> <girng> why is there a .parse method in the Markdown library?
<FromGitter> <watzon> It allows you to define a renderer
<FromGitter> <watzon> Thinking about attempting to implement Ruby's `Marshal` in Crystal
<FromGitter> <wontruefree> there have been some issues on irc I believe talking about this
<FromGitter> <watzon> I've seen them
<FromGitter> <watzon> I don't believe anything is actually planned at the moment for the standard library though
<FromGitter> <wontruefree> I dont think anything is planned
<FromGitter> <wontruefree> what are you plans?
<FromGitter> <wontruefree> I thought there were a few structural problems ?
<FromGitter> <watzon> I'll have to look back over what's been said
<FromGitter> <wontruefree> I am trying to find the issues now
<FromGitter> <watzon> It was a forum post, apparently there's no issue for it
<FromGitter> <wontruefree> there is also this https://github.com/crystal-community/icr/issues/79
<FromGitter> <watzon> There is this crystal-lang/crystal#6309
<FromGitter> <wontruefree> I remember chatting with someone about this but I dont know where that was
<FromGitter> <watzon> I'd like for Marshal to have out of the box support by being added directly to `Object`
<FromGitter> <watzon> but I really don't know what I'm going to do yet
<FromGitter> <wontruefree> well ruby uses it for a database, drb, and irb right ?
<FromGitter> <watzon> I believe so. They use is for a lot.
<FromGitter> <j8r> @watzon I've done a draft for
<FromGitter> <watzon> Oh? Link me if you could
sorcus has quit [Ping timeout: 264 seconds]
<FromGitter> <wontruefree> is it this one https://github.com/j8r/crystal/tree/marshalling
<FromGitter> <j8r> no
<FromGitter> <j8r> this isn't really like go marshalling in fact
<FromGitter> <j8r> more about out of the box serialization
<FromGitter> <watzon> Exactly
<FromGitter> <watzon> Exporting and importing binary representations of objects is what I'm going for
<FromGitter> <j8r> ha ok
<FromGitter> <Blacksmoke16> ah, so not json?
<FromGitter> <watzon> I'd like to have it conditionally compatible with Ruby's Marshal too, so that Ruby objects can be exported from Ruby and imported into Crystal
<FromGitter> <watzon> And vice -versa
<FromGitter> <j8r> then yes, @waj has worked on it
<FromGitter> <watzon> Looks like he hasn't worked on it in quite a while though
<FromGitter> <watzon> Last commit was 4 years ago
<FromGitter> <mwlang> hmmm... https://github.com/Papierkorb/cannon
<FromGitter> <mwlang> for me, I mostly need to serialize and deserialize to Redis
<FromGitter> <mwlang> so I can do number crunching in Crystal and presentation in Ruby
<FromGitter> <mwlang> so that pretty much means, I'm serializing as strings, not binary as Marshal does.
<FromGitter> <Blacksmoke16> could your serialize to json then just write the bytes into redis
<FromGitter> <mwlang> going from Ruby to Crystal and back, sounds pretty nifty, but would require fairly careful construction of classes/structs on both sides.
<FromGitter> <mwlang> That's what I'm doing.
<robacarp> yeah don't marshal
<FromGitter> <mwlang> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1bc51b5ce02535b00e414a]
<FromGitter> <mwlang> and then on the Ruby side... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1bc57484e3391a5ac2b024]
sorcus has joined #crystal-lang
<FromGitter> <mwlang> it's slightly more complex than needs to be only because I can deserialize what was Marshal dumped from Ruby side too.
<FromGitter> <mwlang> in any event, works very, very well for me across the board.
<robacarp> so the gist here is that crystal is doing some calculation but you're displaying it with rails or something?
<robacarp> or are you running crystal as a background job processor or something?
absolutejam1 has quit [Ping timeout: 258 seconds]
absolutejam1 has joined #crystal-lang
absolutejam2 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 272 seconds]
<FromGitter> <mwlang> I'm gathering data from binance exchange, crunching numbers (RSI, Bollinger bands, etc.) and then displaying through Ruby on Rails app and specifically with Plot.ly charting.
<FromGitter> <mwlang> microservices architecture, basically.
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Client Quit]
absolutejam1 has joined #crystal-lang
<absolutejam1> think I dc'd before my messages sent...
<absolutejam1> Is there a de facto templating language for Crystal?
<absolutejam1> Like go template, irb for Ruby, jinja (unofficially) for Python?
<rkeene> mwlang, Have you been to the binance offices ?
absolutejam2 has quit [Ping timeout: 268 seconds]
<FromGitter> <Blacksmoke16> there is https://crystal-lang.org/api/master/ECR.html
<FromGitter> <Blacksmoke16> in stdlib
<FromGitter> <cfsamson> Does anyone know if it's possible to emit LLVM IR or ASM from the Crystal compiler?
<FromGitter> <watzon> I know you can do inline assembly with the `asm` macro
<FromGitter> <watzon> Idk about emitting bytecode though
<FromGitter> <cfsamson> yep, but I want to see the code generated. Found a blog post about it though :)
<FromGitter> <PlayLights_twitter> Hey guys, do you how to create a cast? I would like to cast an object from one class to another
<FromGitter> <PlayLights_twitter> like `vehicule.as(car)`
<FromGitter> <girng> asterite mentioned that crystal can output literal C code
<FromGitter> <girng> i wish there was a crystal playground for that, would be very cool imo
<FromGitter> <cfsamson> It wasnt difficult (bit I couldn't find it documented). Just add `--emit-llvm-ir`. Sounds a bit strange if Crystal can output C since it uses LLVM as a backend but maybe someone made a transpiler or something for Crystal? Or, I don't know, maybe there is something I don't know about :)
<FromGitter> <watzon> Omg why didn't I know about this before? https://docs.ruby-lang.org/en/2.4.0/syntax/refinements_rdoc.html
sorcus has quit [Ping timeout: 252 seconds]
absolutejam1 has quit [Ping timeout: 272 seconds]
<FromGitter> <girng> wow the font on their site is terrible
<FromGitter> <watzon> Yeah that's most rdoc generated sites for ya
<FromGitter> <girng> looks like it's just the letter `s`
<FromGitter> <girng> it's fck'd
<FromGitter> <watzon> Hmm, I wonder what font it's loading on your machine
<FromGitter> <watzon> Looks fine on mine
<FromGitter> <girng> what's your operating system?
<FromGitter> <watzon> I'm on linux
<FromGitter> <watzon> MX Linux to be exact
<FromGitter> <watzon> Using Brave browser
<FromGitter> <girng> hmm, windows 10 here. so prob os font issue
<FromGitter> <girng> u r right
<FromGitter> <watzon> Probably