ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
greengriminal has joined #crystal-lang
<FromGitter> <bew> very interesting talk: https://www.youtube.com/watch?v=944GjKxwMBo about how to simplify and enhance std::string in C++
<FromGitter> <bew> I like where this talk is going, I'd love to see that in Crystal too
<FromGitter> <faustinoaq> @bew Nice πŸ‘
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
thews has quit [Excess Flood]
daemonwrangler has quit [Ping timeout: 256 seconds]
thews has joined #crystal-lang
thews has joined #crystal-lang
thews has quit [Changing host]
daemonwrangler has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
jhass|off has joined #crystal-lang
f1refly has quit [Ping timeout: 256 seconds]
jhass has quit [Quit: Bye]
jhass|off is now known as jhass
txdv has quit [Ping timeout: 264 seconds]
f1refly has joined #crystal-lang
txdv has joined #crystal-lang
Renich has quit [Ping timeout: 260 seconds]
txdv has quit [*.net *.split]
snsei has quit [*.net *.split]
alex`` has quit [*.net *.split]
moei has quit [*.net *.split]
fifr[m] has quit [Ping timeout: 256 seconds]
kp666[m] has quit [Ping timeout: 276 seconds]
braidn[m] has quit [Ping timeout: 256 seconds]
cptaffe has quit [Ping timeout: 256 seconds]
olbat[m] has quit [Ping timeout: 277 seconds]
kixune[m] has quit [Ping timeout: 277 seconds]
byteflame has quit [Ping timeout: 277 seconds]
moei has joined #crystal-lang
alex`` has joined #crystal-lang
snsei has joined #crystal-lang
txdv has joined #crystal-lang
moei has quit [Max SendQ exceeded]
alex`` has quit [Max SendQ exceeded]
alex`` has joined #crystal-lang
moei has joined #crystal-lang
alex`` has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
sz0 has quit [*.net *.split]
jokke has quit [*.net *.split]
marius has quit [*.net *.split]
johndescs has quit [*.net *.split]
davic has quit [*.net *.split]
tilpner has quit [*.net *.split]
Liothen has quit [*.net *.split]
Liothen has joined #crystal-lang
tilpner has joined #crystal-lang
davic has joined #crystal-lang
johndescs has joined #crystal-lang
marius has joined #crystal-lang
jokke has joined #crystal-lang
sz0 has joined #crystal-lang
alex`` has joined #crystal-lang
daemonwrangler has joined #crystal-lang
sz0 has quit [Max SendQ exceeded]
pabs has quit [*.net *.split]
oprypin has quit [*.net *.split]
salvor has quit [*.net *.split]
coderobe has quit [*.net *.split]
aurieeeh has quit [*.net *.split]
shelvac2 has quit [*.net *.split]
wmoxam has quit [*.net *.split]
bmcginty has quit [*.net *.split]
ua has quit [*.net *.split]
Raimondi has quit [*.net *.split]
go|dfish has quit [*.net *.split]
Vexatos has quit [*.net *.split]
kosmonaut has quit [*.net *.split]
aurieeeh has joined #crystal-lang
wmoxam has joined #crystal-lang
coderobe has joined #crystal-lang
shelvac2 has joined #crystal-lang
salvor has joined #crystal-lang
oprypin has joined #crystal-lang
pabs has joined #crystal-lang
go|dfish has joined #crystal-lang
Vexatos has joined #crystal-lang
kosmonaut has joined #crystal-lang
Raimondi has joined #crystal-lang
ua has joined #crystal-lang
bmcginty has joined #crystal-lang
sz0 has joined #crystal-lang
p0p0pr37 has quit [*.net *.split]
jsn- has quit [*.net *.split]
emilsp has quit [*.net *.split]
faustinoaq has quit [*.net *.split]
DTZUZU has quit [*.net *.split]
justinmcp_ has quit [*.net *.split]
bmcginty has quit [*.net *.split]
ua has quit [*.net *.split]
Raimondi has quit [*.net *.split]
go|dfish has quit [*.net *.split]
Vexatos has quit [*.net *.split]
kosmonaut has quit [*.net *.split]
pabs has quit [*.net *.split]
oprypin has quit [*.net *.split]
salvor has quit [*.net *.split]
coderobe has quit [*.net *.split]
aurieeeh has quit [*.net *.split]
shelvac2 has quit [*.net *.split]
wmoxam has quit [*.net *.split]
alex`` has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
jokke has quit [*.net *.split]
marius has quit [*.net *.split]
johndescs has quit [*.net *.split]
davic has quit [*.net *.split]
tilpner has quit [*.net *.split]
Liothen has quit [*.net *.split]
txdv has quit [*.net *.split]
snsei has quit [*.net *.split]
greenbigfrog has quit [*.net *.split]
andersh has quit [*.net *.split]
jokke1 has quit [*.net *.split]
Majost has quit [*.net *.split]
thi_ has quit [*.net *.split]
DTZUZO has quit [*.net *.split]
literal has quit [*.net *.split]
Totoro has quit [*.net *.split]
thews has quit [*.net *.split]
jetpack_joe has quit [*.net *.split]
aarongodin has quit [*.net *.split]
WA9ACE has quit [*.net *.split]
z64 has quit [*.net *.split]
yopp has quit [*.net *.split]
FromGitter has quit [*.net *.split]
Guest98178 has quit [*.net *.split]
GoldenBear has quit [*.net *.split]
jwaldrip has quit [*.net *.split]
ilovezfs_ has quit [*.net *.split]
gewo has quit [*.net *.split]
f1refly has quit [*.net *.split]
jhass has quit [*.net *.split]
DeBot has quit [*.net *.split]
avdi has quit [*.net *.split]
sz0 has quit [*.net *.split]
moei has quit [*.net *.split]
asterite has quit [*.net *.split]
wuehlmaus has quit [*.net *.split]
Guest97416 has quit [*.net *.split]
return0e_ has quit [*.net *.split]
jfontan has quit [*.net *.split]
salvor has joined #crystal-lang
go|dfish has joined #crystal-lang
daemonwrangler has joined #crystal-lang
yopp has joined #crystal-lang
gewo has joined #crystal-lang
commavir has joined #crystal-lang
ilovezfs_ has joined #crystal-lang
moei has joined #crystal-lang
tilpner has joined #crystal-lang
_whitelogger has joined #crystal-lang
olbat[m] has joined #crystal-lang
yaewa has joined #crystal-lang
moei has quit [Ping timeout: 260 seconds]
yaewa has quit [Remote host closed the connection]
moei has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
braidn[m] has joined #crystal-lang
fifr[m] has joined #crystal-lang
byteflame has joined #crystal-lang
cptaffe has joined #crystal-lang
kp666[m] has joined #crystal-lang
Renich has joined #crystal-lang
kixune[m] has joined #crystal-lang
<oprypin> bew, tl;dw what exactly is crystal missing?
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 252 seconds]
p0p0pr37_ is now known as p0p0pr37
csk157 has joined #crystal-lang
return0e_ has quit []
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
csk157 has quit [Ping timeout: 256 seconds]
Nathanaelle has quit [Ping timeout: 256 seconds]
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
Nathanaelle has joined #crystal-lang
r3m has joined #crystal-lang
csk157 has joined #crystal-lang
johndescs_ has joined #crystal-lang
johndescs has quit [Ping timeout: 245 seconds]
johndescs_ is now known as johndescs
p0p0pr37_ has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 252 seconds]
p0p0pr37_ is now known as p0p0pr37
snsei has quit [Remote host closed the connection]
<FromGitter> <fgimian> Hey guys, I'm working with binary data atm and attempting to accomplish this in Crystal ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b0d1947c712f561253ec25e]
<FromGitter> <fgimian> Is there any way to do this using the stdlib
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon1 has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 255 seconds]
<FromGitter> <fgimian> I believe Ruby has a pack and unpack method in appropriate types too, unpack in strings and pack in arrays
That_Guy_Anon1 is now known as That_Guy_Anon
<FromGitter> <bararchy> Can I tell `rand` to give me true or false
<FromGitter> <straight-shoota> @bararchy `rand > 0.5`?
<FromGitter> <bararchy> Oh, found it Random.new.next_bool
<FromGitter> <bararchy> :)
<FromGitter> <fgimian> I was going to suggest: ⏎ ⏎ ```puts rand <= 0.5 ? true : false``` [https://gitter.im/crystal-lang/crystal?at=5b0d24f7c712f561253ee937]
<FromGitter> <fgimian> hehe πŸ˜„
<FromGitter> <straight-shoota> oh, didn't see that
<FromGitter> <bararchy> Works nicly
<FromGitter> <straight-shoota> @fgimian there is `IO#read_bytes` and `IO#write_bytes` but this only works with primitives IIRC
<FromGitter> <fgimian> @straight-shoota thanks a lot mate, I'll give them a try πŸ˜„
alex`` has quit [Ping timeout: 245 seconds]
yaewa has joined #crystal-lang
moei has quit [Ping timeout: 255 seconds]
<FromGitter> <fgimian> Hmm, I'm honestly not sure that this is doing what I'm after. Although my understanding of binary data is pretty limited.
greengriminal has joined #crystal-lang
<FromGitter> <Grabli66> Is there an easy way to convert method with yield to iterator?
<FromGitter> <bararchy> RX14 lol why did @asterite closed those ?
<RX14> i think ary closed all his github issues on crystal
<FromGitter> <codenoid> is there any crystal library like https://github.com/ahmdrz/goinsta
<FromGitter> <codenoid> it's cool bcoz doesn't need webdriver or official api
<FromGitter> <codenoid> just login with my insta username & password <3
<FromGitter> <r00ster91> theres a scraper https://github.com/MiguelSavignano/crystal-instagram-scraper
<FromGitter> <codenoid> goinsta can upload media too
alex`` has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #6133: Feature: File Atomic Write (master...feature/atomic_write) https://git.io/vhqMw
<FromGitter> <vladfaust> Any ETA on 0.25.0? It has 99% milestone
<FromGitter> <fridgerator> Sounds like very soon
<crystal-gh> [crystal] RX14 closed pull request #6142: Fixes documentation of Char.hex? (master...char-documentation) https://git.io/vhY5I
<RX14> next two weeks for sure
<FromGitter> <r00ster91> i hope https://github.com/crystal-lang/crystal/pull/6055 will get merged before 0.25.0
<RX14> why?
<RX14> it's just a fairly useless code cleanup
<FromGitter> <vladfaust> Regarding to Ary, don't you think such a bus factor could affect further Crystal's fate?
<RX14> that code cleanup has already generated false positives and broken code
<RX14> so i'd have to triple check that PR before merging
<FromGitter> <vladfaust> I mean, he could spend time on reducing such a factor, telling how Crystal compiler exactly works
<RX14> and blegh
<FromGitter> <r00ster91> do you think that --release will anyway optimitze this?
<RX14> what
<FromGitter> <r00ster91> the useless assigns
<RX14> maybe
<RX14> depends on how LLVM can prove stuff about side-effects
<FromGitter> <j8r> https://github.com/crystal-lang/crystal/pull/6110 is now ready to merge. This will remove some potential new issues if released before 0.25.0
<RX14> no its not
<FromGitter> <j8r> really?
<RX14> nope
<FromGitter> <j8r> Tell me what do do :-)
<FromGitter> <r00ster91> you didnt fixed for example that the error looks like this right now: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b0d4a63a45f930a65e37451]
<FromGitter> <r00ster91> theres no space
<FromGitter> <j8r> hum right
<RX14> just put the strong on one line please
<RX14> no weird escaping newline
<RX14> string*
<FromGitter> <j8r> I would like to \n
<FromGitter> <j8r> but missed it
<RX14> just use a heredoc then
<RX14> no
<RX14> it's ugly
<RX14> just use heredoc please
<faustinoaq> RX14, hehe, that's true, multiline "strings" are ugly, see: https://github.com/amberframework/micrate/blob/master/src/micrate/cli.cr#L65
<RX14> yeah that'd be much better off as a heredoc
<RX14> I never use multiline strings
<RX14> perhaps they should be disabled
<FromGitter> <j8r> they are useful programatically
<RX14> you can use heredocs the same
<crystal-gh> [crystal] AlexWayfer opened pull request #6143: Add `Enumerable#grep(klass : T.class) forall T` (master...add_grep_for_class) https://git.io/vhOH0
<RX14> i.e. use heredocs just put the END at column 0
<RX14> and you have almost the same semantics as multiline strings
<RX14> but with less escaping
<FromGitter> <fgimian> πŸ‘―
<FromGitter> <fgimian> I'm aware of read_bytes, but this requires a particular type to be specified that forces multiples of 2 bytes
<RX14> yes
<RX14> I'm confused from your example what you want to do
<RX14> ruby's pack is just unreadable to me
<RX14> if you could explain the binary format you're trying to parse it'd be much easier
<FromGitter> <fgimian> ``` buffer = Bytes.new(offset_size * number_of_objects) ⏎ data = file.read(buffer)``` [https://gitter.im/crystal-lang/crystal?at=5b0d4fb5a7abc8692ef242c3]
<FromGitter> <fgimian> I think this is what I want πŸ˜„
<travis-ci> crystal-lang/crystal#61da45f (master - fixes documentation (#6142)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/385175677
<DeBot> https://github.com/crystal-lang/crystal/pull/6142 (Fixes documentation of Char.hex?)
duane has joined #crystal-lang
<FromGitter> <j8r> on macros I find `\` also useful
<RX14> @fgimian you probably want read_fully
<hmans> <3 Crystal <3
<hmans> I've spent the last couple of days diving into both Rust (because everybody is loving it), Go (well...) and Pony (yeeaaahhh... it's nice)
<hmans> It's been interesting and fun
<hmans> but even now, I prefer Crystal to all those.
<hmans> Pony is really really interesting, but it hasn't been as _nice_ to work with as Crystal's Rubyisms.
<hmans> Rust is pretty great, but also... well... not as fun. I do understand why everybody is raving about it, though.
<hmans> Go surprised me by evoking similar emotions in me to, say, Java, which is not what I expected.
<hmans> ie. it's largely okay, but also kind of boring. It's just there, and it works, and it has no real surprises (neither good nor bad.) It's just... there.
<FromGitter> <Grabli66> Nim? :)
<hmans> Oh yeah, Nim!
wontruefree has joined #crystal-lang
<hmans> It's been a while since I last checked that one out, but I remember it clicking with me quite well.
<hmans> This time I wanted to focus on languages that have, let's say, opinions on parallelism... Nim is similar to Crystal in that regard, right?
<hmans> Either way, I'm a sucker for indentation-based languages, so syntax-wise, I was enjoying Nim a lot
wontruefree has quit [Client Quit]
<hmans> If Ruby and/or Crystal dropped `end` and went indentation-based, I'd be cool with that, but that's just how I roll. I know many people feel the opposite
<FromGitter> <drujensen> yup, I don’t roll that way. ;-)
<hmans> I'm weird, I know.
<FromGitter> <drujensen> no, just different
<FromGitter> <fgimian> Hey guys, suppose I have the my type defined in a variable and I wish to use that in my array declaration ⏎ ⏎ e.g. ⏎ ⏎ ```type = Int8 ⏎ stuff = Array(<type??>).new(10)``` [https://gitter.im/crystal-lang/crystal?at=5b0d576bb6eece791dc0b561]
wontruefree has joined #crystal-lang
<hmans> I'm that one guy who, when forced to build a JS app, uses CoffeeScript for everything because haters gonna hate. It's become a bit of a running gag in my team, where I keep getting mocked for this, but one day I shall have my revenge, the rivers will flow red with the blood of my enemies, etc.
<FromGitter> <fgimian> is this possible?
<FromGitter> <fgimian> and if so, what's the best way to approach it
<hmans> fgimian, I would bet against it since it wouldn't be known at compile time, right?
<FromGitter> <drujensen> haha
<FromGitter> <fgimian> that's correct yeah, it is during the reading of a binary file, where this can vary based on the file
<FromGitter> <fgimian> can you suggest a better approach?
<hmans> fgimian, not really, but I'm also just still starting out with the Crystals.
<FromGitter> <fgimian> no problem, me too πŸ˜„
<FromGitter> <fgimian> thanks a lot for the reply
<hmans> I have been wondering if there is some sort of root type (similar to Ruby's Object) that could serve as a catch-all type in generics?
<FromGitter> <fgimian> I'm trying to write a parser for mac plist files (property lists), which are often in binary format
<FromGitter> <fgimian> I'm making progress, but just hit this one πŸ˜„
<FromGitter> <fgimian> yeah not sure
<hmans> Could you cheat and maybe deal with all of the stuff you're parsing as Strings?
<FromGitter> <fgimian> I'm afraid not bud, they are all UInts
<hmans> And then -- at a later stage -- run those strings through parsers that emit the intended type? (I'm just guessing, I know too little of the context of what you're doing)
<RX14> @fgimian what code are you trying to do with a type in a variable?
<RX14> i mean whats your usecase
<hmans> drujensen, oh, TIL! So far I had assumed Value and Reference were root types. Please don't ask why I thought that.
<FromGitter> <fgimian> sure, I'm parsing mac property lists which are in binary format
<FromGitter> <fgimian> let me share a little snippet of my code to put it into context
<RX14> yes please
<FromGitter> <drujensen> @hmans you might want to use Generics https://crystal-lang.org/docs/syntax_and_semantics/generics.html
<FromGitter> <fgimian> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b0d58f852e35117cdee092a]
<FromGitter> <fgimian> sorry it's a big longer than I expected lol
<FromGitter> <fgimian> this is what I'm up to πŸ˜„
<FromGitter> <faultyserver> why does `object_offsets` need to be of a variable type?
<FromGitter> <faultyserver> why not just make some `Offset` class that has a `size` property or something
<FromGitter> <faultyserver> or just use the largest denominator and use Int64
<RX14> yeah
<RX14> one option is to just read them all in as U64s
<FromGitter> <faultyserver> well, read the appropriate number of bytes, but then store it in a U64
<RX14> well yeah thats what I meant
<FromGitter> <fgimian> thanks guys, yeah I did consider that too
<FromGitter> <fgimian> not a bad idea
<RX14> and you don't need to do the IO::Memory stuff at all
<FromGitter> <fgimian> worst case, I can just have an if statement there
<FromGitter> <fgimian> which simply constructs one of the 4 types of arrays
<RX14> you can just use buffer.read_bytes directly
<FromGitter> <fgimian> or a case statement .etc
<RX14> you'd still end up with a union of all those types
<FromGitter> <fgimian> valid point RX14
<FromGitter> <fgimian> you're right
<RX14> which would be ugly to work with
<FromGitter> <fgimian> thanks
<FromGitter> <faultyserver> unrelated, but is there any roadmap for when 0.24.3 (or 0.25.0 or whatever) might get released?
hmans has left #crystal-lang [#crystal-lang]
<FromGitter> <fgimian> I'm porting this over from the Python code, and so it's easy to be influenced by the original implementation
<FromGitter> <faultyserver> really looking forward to the automatic casts
<FromGitter> <hmans> @faultyserver There's a milestone on Github which is almost at 100%. I understand the changelog is already being written?
<FromGitter> <faultyserver> awesome
wontruefree has quit [Quit: bye]
<FromGitter> <fgimian> I think I'll try a case statement for now πŸ˜„
<FromGitter> <fgimian> that won't be so bad
<FromGitter> <fgimian> p.s. I'm excited about the next release too!!! I'm running the master branch on my Mac atm πŸ˜„
<RX14> @fgimian But then you'll get an (Array(UInt8) | Array(UInt16) | Array(UInt32) | Array(UInt64))
<FromGitter> <fgimian> oh
<FromGitter> <fgimian> good point
<RX14> and it's be much easier to just use u64's everywhere
<FromGitter> <fgimian> with unions, each item will use up the memory required for each item right?
<FromGitter> <fgimian> e.g. in that union, i would need 15 bytes per item?
<RX14> no
<FromGitter> <fgimian> oh cool
<RX14> unions have a type tag and then follow the value
<RX14> if it was Array(UInt8 | ... | UInt64) you'd have a 32-bit tag and then the data
<RX14> which must be 64 bits because thats the largest size
<FromGitter> <fgimian> aaaaaaaaaah gotcha
<RX14> and then you'd have an array of those
<FromGitter> <fgimian> I see your point
<FromGitter> <fgimian> thanks so much for the explanation and help πŸ˜„
<RX14> for Array(UInt8) | Array(...) | Array(UInt64) you waste a lot less space
That_Guy_Anon has quit [Ping timeout: 252 seconds]
<RX14> because each array is optimally layed out
<RX14> and the only overhead is in the original dereference
wontruefree has joined #crystal-lang
<RX14> but it's still hearder to deal with than just an Array(UInt64)
<RX14> in code
<RX14> you'll have to cast around when using it
<RX14> and most code will just end up casting to UInt64 anyway
<RX14> so
<RX14> idk
<FromGitter> <fgimian> yeah I know what you mean
<RX14> I don't know enough about plist files to know what the best typed API for them is
<RX14> how does C do it?
<FromGitter> <fgimian> same here; honestly not sure
<FromGitter> <fgimian> I might look at the Ruby implementation to see what they do too
<RX14> ruby isn't typed
<RX14> it'll just return numbers
<FromGitter> <fgimian> true
<RX14> which i guess is eqwuivalent to always returning a U64
<FromGitter> <fgimian> well actually
<FromGitter> <fgimian> what you said is true
<FromGitter> <fgimian> because the only place those numbers are used is when seeking in the file
<FromGitter> <00dani> plists are approximately the same structure as JSON, so whatever Crystal already does for JSON is probably about right.
<FromGitter> <fgimian> I think I'm going to go with the option you mentioned, UInt64 everywhere
<RX14> oh yeah
<FromGitter> <fgimian> @00dani cool, I wasn't aware of that. This is my first time ever dealing with binary parsing πŸ˜„
<FromGitter> <fgimian> RX14: your suggestion worked perfectly
<RX14> this is just the offset table
<FromGitter> <fgimian> thanks!
<RX14> so U64 is definitely the way to go
<RX14> it's just compression
<FromGitter> <fgimian> yeah
<FromGitter> <fgimian> totally makes sense
<FromGitter> <fgimian> thanks again, I'll get there slowly, sorry for all the questions
<FromGitter> <00dani> Yeah, there's a few different plist formats (binary, XML, an ASCII one which is way better than the XML one but deprecated) but the data model's the same between them and it's basically just JSON, so the appropriate typed API for it is JSON. :P
<RX14> for parsing it you'll probably want to implement a pull parser first
<RX14> all the JSON and YAML stuff in crystal is built off pull parsers because they are by far the most flexible and low-level interface to arbitrarily typed datastructures like json
<RX14> i suggest you look them up becfore trying to parse it like you would in a dynamic language
<RX14> because in crystal it will get very messy very fast
<FromGitter> <fgimian> gotcha
<FromGitter> <fgimian> will definitely check out the JSON parser
<RX14> definitely check out JSON::PullParser
<FromGitter> <fgimian> indeed the final output should match the JSON parser as plist formats are indeed similar
<FromGitter> <fgimian> thanks a lot
<RX14> then check out how from_json and JSON.mapping are built on top of the pull parser
<RX14> because it's much easier to do it that way then the other way around
<FromGitter> <fgimian> gotcha
<FromGitter> <fgimian> will definitely do
<FromGitter> <fgimian> thanks heaps!
greengriminal has quit [Quit: Leaving]
greengriminal has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
greengriminal has quit [Quit: Leaving]
<FromGitter> <Willamin> does `crystal run` get cached in `$HOME/.cache/crystal` to speed things up?
<RX14> yeah
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Remote host closed the connection]
<FromGitter> <Willamin> Has there been discussion for further caching for `crystal run`? One thing I've tried (with decent success) is a small program that I can use in place of `crystal run`. It computes a digest of the contents of the crystal script, runs `crystal build` against the script, renames the binary based on the digest, and runs the binary. The next time the I run it, the `crystal build` step is skipped in favor of simply
<FromGitter> ... executing the binary. If the crystal script's contents ever change, the digest changes, which indicates that it needs to run `crystal build`. ⏎ I just did a quick benchmark and it seems like this technique could be useful if included in `crystal run`itself, with some tweaking. The way I've done it doesn't take into accou ... [https://gitter.im/crystal-lang/crystal?at=5b0d76bdedd06f7d15f21843]
<FromGitter> <Willamin> I didn't see one, but if there's a github issue or PR or a forum thread that's specifically about this type of improvement, definitely let me know and I'll read up on previous discussion.
<wmoxam> Would be interested to see Crystal's results ^^
alex`` has quit [Quit: WeeChat 2.1]
<RX14> 0
<RX14> well
<RX14> huh
<RX14> not sure how luajit gets better than C performance
<FromGitter> <Willamin> here's a blog post about the ffi-overhead https://nullprogram.com/blog/2018/05/27/
<FromGitter> <Willamin> they mention how luajit is faster than C
<FromGitter> <Willamin> > The benchmark was run on Linux, so the performance penalty we’re seeing comes the Procedure Linkage Table (PLT)
<RX14> thanks for the link
csk157 has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
Raimondii has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Nathanaelle has quit [Read error: Connection reset by peer]
Raimondii is now known as Raimondi
Nathanaelle has joined #crystal-lang
alex`` has joined #crystal-lang
bmcginty has quit [Ping timeout: 264 seconds]
bmcginty has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 260 seconds]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
<FromGitter> <r00ster91> So i'm getting JSON from an API with `HTTP::Client.get(API_URL).body` and if theres for example the character `’` in the JSON then when I print it, it prints `Ҁ™`. Even if my terminal can actually display the character `’` and when I print `’` directly then it also works. How do I make that it gives me valid, expected characters instead of weird, wrong characters?
<oprypin> r00ster91, please provide a sample of the json (preferably the whole server response with headers) and your source code
<oprypin> >>> "’".encode('utf-8').decode('windows-1250')
<DeBot> oprypin: Syntax error in eval:17: unexpected token: > - https://carc.in/#/r/4689
<oprypin> 'Ò€ℒ'
<oprypin> uh that's python, dont worry about it, DeBot
<oprypin> if you're on windows cmd, it's quite probable that it does not expect utf-8
<oprypin> but you said printintg it works
Nathanaelle has joined #crystal-lang
<FromGitter> <r00ster91> well i noticed that its a problem of the API. Not of the data translation or something. The character ’ for example becomes Γ’ ⏎ but im not sure how I can convert that back again to the correct character
<FromGitter> <r00ster91> oh it looks like everything becomes an Γ’ when its not in the char range of 0-255. So this isnt really solvable. Thanks anyway
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
yaewa has quit [Quit: Leaving...]
moei has joined #crystal-lang
Marrow16180 has joined #crystal-lang
Marrow16180 has left #crystal-lang [#crystal-lang]
Marrow16180 has joined #crystal-lang
Marrow16180 has quit [Client Quit]
Marrow16180 has joined #crystal-lang
<Marrow16180> Hi
Marrow16180 has quit [Quit: Leaving]
Nathanaelle has joined #crystal-lang
Marrow16180 has joined #crystal-lang
<FromGitter> <epergo> does anyone know why asterite is no more a core team member? :(
<FromGitter> <r00ster91> for real? he leaved?? :( ⏎ i thought hes just on a vacation or something..
<FromGitter> <epergo> after the issue cleanup I noticed he is no more there
<FromGitter> <Grabli66> Captain abandoned the ship :)
<Marrow16180> Don't worry guys, music is still playing, even if we are sinking, it doesn't really matter :P
csk157 has joined #crystal-lang
<FromGitter> <Grabli66> I think i need to look at Nim again.
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
csk157 has quit [Ping timeout: 268 seconds]
baweaver is now known as lemur
lemur is now known as baweaver
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
<wontruefree> does crystal have a debugger ?
<wontruefree> it looks like you can use the lldb but can you assign variables and call methods ?
<FromGitter> <straight-shoota> Ary hasn't been a public member for quite some tim
<FromGitter> <straight-shoota> *e
wontruef_ has joined #crystal-lang
Nathanaelle has joined #crystal-lang
<oprypin> @epergo @Grabli66 I'm pretty sure he wasn't on the list for like a year
Raimondii has joined #crystal-lang
jsn-_ has joined #crystal-lang
<FromGitter> <epergo> he was on april, and pretty sure he was in last week, it's not the end of the world, but he is a cool guy to be in the core team
<oprypin> epergo, this is a member's view, you don't know about visibility on non-member's view
Raimondi has quit [*.net *.split]
wontruefree has quit [*.net *.split]
jsn- has quit [*.net *.split]
emilsp has quit [*.net *.split]
Raimondii is now known as Raimondi
<FromGitter> <epergo> you are completely right!
emilsp_ble has joined #crystal-lang
<oprypin> r00ster91, your statement made me disproportionately angry. you made no attempt to solve the problem and said that it is impossible.
<FromGitter> <r00ster91> i solved it by just deleting the weird a's
Totoro has quit [Ping timeout: 260 seconds]
<FromGitter> <r00ster91> i didnt you leave them there
Totoro has joined #crystal-lang
<FromGitter> <r00ster91> just*
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
<oprypin> as i was sayinh
<FromGitter> <asterite> i put myself as a private member, that's all
* FromGitter * fridgerator removes tinfoil hat
<FromGitter> <epergo> nice to hear! you're doing great job
Marrow16180 has quit [Quit: Leaving]
<FromGitter> <asterite> was :-P
<wontruef_> nice to see you around again :)
wontruefree has joined #crystal-lang
wontruef_ has quit [Quit: this is not the client you are looking for]
Nathanaelle has quit [Ping timeout: 276 seconds]
faustinoaq has quit [Quit: IRC client terminated!]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Ping timeout: 256 seconds]
wontruefree has quit [Quit: Page closed]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: this is not the client you are looking for]
r3m has left #crystal-lang ["WeeChat 2.2-dev"]
return0e has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e_ has joined #crystal-lang
moei has quit [Quit: Leaving...]
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 256 seconds]
duane has quit [Ping timeout: 256 seconds]
faustinoaq has joined #crystal-lang
moei has joined #crystal-lang
return0e has quit []