asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.0 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ - API: http://crystal-lang.org/api/ - Logs: http://irclog.whitequark.org/crystal-lang
weskinner_mac has joined #crystal-lang
havenwood has joined #crystal-lang
weskinner_mac has quit [Client Quit]
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
DeBot has quit [Quit: Crystal]
DeBot has joined #crystal-lang
gr33n7007h has quit [Ping timeout: 265 seconds]
waj has joined #crystal-lang
waj has quit [Quit: Leaving.]
ponga has joined #crystal-lang
weskinner_mac has joined #crystal-lang
havenwood has quit []
waj has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
waj has quit [Quit: Leaving.]
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ryanf has quit [Remote host closed the connection]
ryanf has joined #crystal-lang
ponga has quit [Remote host closed the connection]
gr33n7007h has joined #crystal-lang
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #crystal-lang
gr33n7007h has quit [Client Quit]
gr33n7007h has joined #crystal-lang
<gr33n7007h> >> h = {} of String => Int32|Float64
<DeBot> gr33n7007h: {}
<gr33n7007h> jhass: what is this syntax: def initialize(@data : T, &@block : T -> T)
<jhass> gr33n7007h: @data assigns the instance variable directly from the parameter. The class you're looking is like defined as class Foo(T), which is a generic. It's how Array and Hash for example do the type handling
<jhass> : T restricts to the captured type, it's not really different from like @data : String
<gr33n7007h> jhass: thanks for clearing that up :)
<jhass> except that it works with any type, but without mixing them all into a big union, because basically a new version of the class is created for each used type
<jhass> &@block captures the passed block and assigns it to @block right away
<jhass> : T -> T makes it take a single parameter of T and return a T
<gr33n7007h> ah, ok let me jot this down ;)
<gr33n7007h> bascically just been browsing through all the crystal samples on github 8)
<gr33n7007h> makes sense now
<gr33n7007h> what was that link to install crystal on debian again?
<gr33n7007h> can't find it
<jhass> gr33n7007h: its in the docs, see /topic
<gr33n7007h> ok
ponga has joined #crystal-lang
havenwood has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/x0fQ
<crystal-gh> crystal/master 07593e0 Julien Portalier: Added: ArrayLiteral#shuffle to macros
<crystal-gh> crystal/master 5bae986 Ary Borenszweig: Merge pull request #454 from ysbaddaden/macros-array-literal-shuffle...
bcardiff has joined #crystal-lang
<travis-ci> manastech/crystal#2068 (master - 5bae986 : Ary Borenszweig): The build is still failing.
<crystal-gh> [crystal] ysbaddaden closed pull request #459: Added: Enumerable#each_slice (master...std-enumerable-each-slice) http://git.io/x8Ah
<crystal-gh> [crystal] asterite closed pull request #458: support binary, octal and hex output (master...master) http://git.io/x8w8
<ponga> n
<travis-ci> manastech/crystal#2069 (master - 848bf8b : Ary Borenszweig): The build is still failing.
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
asterite has joined #crystal-lang
waj has joined #crystal-lang
gr33n7007h has quit [Ping timeout: 250 seconds]
<ytti> >> "%x" % 42
<DeBot> ytti: "x"
<ytti> jhass, not running nigtly/daily? :>
<jhass> nope :P
<ytti> i'm actually curious if it'll replicate this:
<ytti> [1] pry(main)> "%x" % -1
<ytti> => "..f"
<ytti> i don't understand that :)
<ytti> but likely won't, as it'll just call to_s
<ytti> [2] pry(main)> -1.to_s(16)
<ytti> => "-1"
<ytti> ruby clearly is doing something else
<jhass> yeah, Ruby is weird sometimes
<jhass> for example compare .split(" "), to .split(" ", -1) to .split(/ /) to .split(/ /, -1)
<jhass> (on a string with trailing and consecutive whitespace)
<asterite> ytti: I don't think it'll replicate that, I didn't know Ruby did that :)
<ytti> asterite, i've got no clue what is going on there, so hope it does not :)
<asterite> I think it's putting ".." to mean "this is negative" and then the number
<asterite> Like, if you start with all zeros and decrement it
<ytti> [1] pry(main)> "%x" % -2
<ytti> => "..fe"
<ytti> [2] pry(main)> "%x" % -3
<asterite> Mmm… the ".." would mean "f follows to the left"
<ytti> => "..fd"
<asterite> Sounds…. useful :/
<ytti> [16] pry(main)> "%x" % -16
<ytti> => "..f0"
<ytti> wat
<ytti> [17] pry(main)> "%x" % -17
<ytti> => "..fef"
ryanf has quit [Ping timeout: 252 seconds]
ryanf has joined #crystal-lang
<asterite> Well, it has to do a lot of tihngs :)
<asterite> But I'm always amazed to see the source code of ruby methods
<ponga> hey asterite
<ponga> can i ask somethin
<asterite> Like, Array#count, you open it and see like 20 lines of C code, because it has to see if you gave a block and so on
<asterite> ponga: sure
<ponga> you said hi to me in this channel when i came here, but you don't seem to be in other channels that im in
<ponga> but i think i saw your nick somewhere..
<asterite> jhass: wow, so long. But Crystal's will be long too… right now it has some duplicated code
<ytti> jhass, interesting choice for the padding
<ytti> i wonder if that's performance optimization for common case?
<ytti> but is that really so expensive?
<asterite> Oh, it's because I read the logs, come in and say hi if you are online (I think I wanted to ask you about "alis lang" :))
gr33n7007h has joined #crystal-lang
<ponga> asterite:oh.. so i didn't see you before , k
<ponga> but where did you see alis lang
<jhass> ytti: *shrug*
<ponga> its on my own small thing
<ponga> i was quite shocked
<ponga> im like 'is he a cyber stalker or something'
<ponga> ;p
<asterite> ponga: Here someone commented: https://github.com/manastech/crystal/issues/455 and I related that comment to the irc logs and you :)
<ponga> ah
<ponga> ok lol
<asterite> I opened that github profile and saw just one repo, so I was curious… it also had "lang" in it, and I like languages (both for speaking and programming)
<ponga> haha
ryanf has quit [Ping timeout: 245 seconds]
<ponga> i like languages too
<asterite> You speak Esperanto?
<ponga> nop im not fluent enough , but i could read the text/chat in Esperanto, with dictionary next to me(in browser actually), and comprehend it
<ponga> so alis is influenced by how it looks, but syntax is totally different
<ponga> it has so many non-european hints in
<ponga> lang features that many european languages don't have
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
weskinner_work has joined #crystal-lang
<asterite> Interesting. Like what?
<ponga> asterite: particles that add/decide mood of the speaker
<ponga> european langs have some feature to add honorific and so
<ponga> but mood modal, not many, and very limited
<ponga> asterite: for example in korean infinitive for 'go' is ga-da
<ponga> and if you inflect the suffix into -ra
<ponga> its in ordering/command form
<ponga> into -ne, its indicative/casual suggestive mood
<ponga> -na interrogative/uncertainty of future event
<ponga> -z(j)a to ask a favor/ requesting cooperation
<ponga> and so on and so on
<asterite> Sounds interesting :)
<ponga> and of course many more inflections to play social heirchical forms
<asterite> I learned a bit of japanese and the formal/polite modes are hard to digest at first
<ponga> asterite: this feature is very prominent in japanese/korean langs, and what it does enable is that
<asterite> Or the way you talk to your sister depending if she's older or younger… I guess in korean it would be the same
<ponga> unlike many euro langs, just Text sentence can hold many underlining nuances that are often lost in i.e. English
<ponga> asterite: and Alis lang is a lang to have all these features so machine could detect this often lost differences
<ponga> and support to work as better language processing bot
<ponga> oh me being chatty again
<ponga> always get chatty when language is topic
<ponga> ;p
<ponga> so , frankly, i find chatting in English like writing a poem constantly
<ponga> its so much of hassle and fuss to grasp all the intentions
<ponga> ;p
<asterite> :)
<ponga> whereas in korean/japanese, my 1st 2nd langs, its already in the syntax for ya
<ponga> but then
<ponga> asterite: this makes English far more interesting language for a literature
<ponga> cos you can always play with intentions hidden into sentences
<ponga> pro/con
<asterite> I didn't know English was seen like that :)
ryanf has joined #crystal-lang
<ponga> you see if it was in novel just "go" speech text
<ponga> without the context and description following, it'd be much more hidden of a character's intention
<ponga> but in jap/kor the syntax 'forces' you to reveal the mood
<ponga> latter works better for info-transfer purpose but former is more exciting
<asterite> Now I want to learn more of those languages :)
<ponga> asterite: its really, really exciting , in a way that it opens your eyes to whole new different ground of linguistics
<ponga> you just see things that did not exist in your mid
<ponga> *mind
<asterite> Are you korean or japanese? (I guess korean because of the description in alis lang)
<ponga> asterite: korean
<ponga> but its only includes korean cos some koreans are interested in this
Liothen has joined #crystal-lang
<ponga> asterite: therefore, my attempt is that, Written human language is far too ambiguous to process things more complex than siri, unless having google-size database, so i want to convert it into more machine-friendly human-readable language
<ponga> oh and now i sound like XML
<ponga> lol
asterite has quit [Quit: Leaving.]
<weskinner_work> I fee like if intention was more explicit in English, my wife and I would have far fewer arguments :P
<ponga> nice one :p
<weskinner_work> I kid. This is quite interesting ponga. I missed the beginning of the convo. Is Alis a natural language you are working on?
<ponga> weskinner_work: yes artificial natural language that works as middleway/ or like interpreter between machine and human
<ponga> and of course easy to learn, so between humans too, but is 2nd purpose
<ponga> weskinner_work: its for chatbot that could understand speaker's emotional ,deep, intentions too
<ponga> it's going to include all lang features and possibilities i've known in my life
<ponga> it also borrows noun combinations in Chinese
<ponga> idea of pypy (computer lang)
<ponga> *borrows 'concept/theory' of noun combination in chinese
<weskinner_work> interesting. do you have a site or anything out there?
<ponga> weskinner_work: just the github page for now
<ponga> would you like link?
<weskinner_work> I was able to find on google :)
<ponga> oh really? its only week old
<ponga> gud
<weskinner_work> "alis github"
<ponga> weskinner_work: its quite unlike usual language project by linguist, cos im deeply influenced by programming/IT world
<ponga> and computation is the future, it fascinated me so much
<ponga> for example, the dictionary will serve a style guide too
<ponga> not just the lexicons
<ponga> i was shocked seeing all API librarys of langs in IT and thought 'why didn't linguists think of this?!' with anger
<ponga> hehe
<ponga> you guys are awesome
<weskinner_work> I've thought the same thing. Occasionally I get the desire to learn a new natural language but the books are so much harder to pick up than a manual for a programming language.
<ponga> weskinner_work: i thought of that when i was 17
<ponga> that why would dictionary speak much more of language style
<ponga> rather than displaying mere lexicons and example sentences
<ponga> you see, English is my 3rd language
<ponga> weskinner_work: i studied a bit on artificial natural langs, and the reason they failed is just like how a programming lang fails, "no killer content" "no motivation"
<ponga> alis lang pursue for better machine-human communication , improving bot/AI exprience
<ponga> and further more i believe it could develop into fine automatic translator
<ponga> so many japanese/koreans who have difficulties learning English could access English/International information on web
<ponga> you know, Jap/Kor are so different lang to Eng so its very hard for them to learn it
<ponga> and access of information in nearly every field is too limited to them due to that ;(
<jhass> ponga: do you know the official ruby docs? ;)
<ponga> oh my im chatty again, sorry
<ponga> jhass: hm i have access to doc page and 'ruby progrraming language' book by matz
<ponga> why?
<jhass> that's the official reference docs
<ponga> oh
<ponga> its in Japanese?!
<jhass> yes!
<ponga> where's English gone
<ponga> omg
<ponga> that's ..sad
<ponga> jhass: are you referring to my conv by that
<ponga> or you wanted to show me cos i speak japanese
<jhass> it was about the Japanese having trouble with English part, we got the problem the other way around too ;)
<ponga> haha
asterite has joined #crystal-lang
<ponga> jhass: Kor/Jap <-> Eng Translation is horrid, horribly painful work of art
<jhass> yeah, one notices when watching anime dubbed to german vs dubbed to english vs subtitled to either
<ponga> when you go deeper and deeper, it just gets to the the level where it seems they are from different planet
<jhass> like in princess kaguya, one really notices that ghibli did work on the english subtitles itself
<jhass> opposed to completely outsourcing that
<ponga> jhass: Perfectly translated English setence from Japanese is a remarkable work
<ponga> its just art of language when you know both lang
<jhass> definitely
<ponga> how translator carefully choose right terminologies , to suit the nuance, culture, emotion, intention, etc
<jhass> movie dubbing is highly interesting in that topic too
<ponga> its like masterchef
<jhass> like some movies get popular in some foreign countries because the dubbing actually adds to it over the original
<ponga> jhass: i personally like having 'sensei' as 'sir' or 'miss' because i attended Brit style school
<ponga> catholic ones where they call their teachers by title 'sir' 'miss'
<ponga> and i find similarity
<ponga> rather than american version of 'mr blah' 'ms blah'
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
<weskinner_work> As promised, my (rough) port of Tetris to Crystal: https://github.com/weskinner/crystal-tetris
<weskinner_work> still working on rendering the score and need to fix the end game state but the mechanics are there
<weskinner_work> the code is UGLY :P. Will eventually refactor
<asterite> Cool! Is the Projectfile missing?
<asterite> Ah, no...
<asterite> Mmm… it's strange to put the Projectfile inside src :)
<asterite> But it's not your fault, it's not documented anywhere
<jhass> bah, you need to map out the arrow keys :P
<jhass> my left hand can't play tetris :D
<asterite> Yay, it works! :)
<asterite> It looks nice. I like how you can see where the piece will fall
<weskinner_work> asterite: the Projectfile will eventually move to the root when I get rid of orig/
<weskinner_work> yeah the "ghost" piece is a nice touch :)
<weskinner_work> jhass: I had them mapped originally but the key code's bugged for some reason, still working on that :P
asterite has quit [Read error: Connection reset by peer]
<jhass> mmh, it hangs when you loose :P
<weskinner_work> it's a punishment :P
ismaelga has joined #crystal-lang
<weskinner_work> \/feature :)
asterite has joined #crystal-lang
<jhass> but very nice one indeed :)
<weskinner_work> thank you. it's really sped up right now too for testing. won't be that fast
<asterite> weskinner_work: I really like it :)
<jhass> btw use .nil? for explicit nil checks, but in most cases you can just do if @var
<asterite> By the way, you can use some of the bindings for sdl2 here: https://github.com/ggiraldez/crystal-pong/tree/master/libs/sdl2
<asterite> They are not complete, but the keyboard is bound well, I think
<jhass> also prefer "literal #{code}" over "literal " + code :)
<weskinner_work> jhass: I need to go and update where I was doing that :). Still getting used to ruby / crystal syntax
<weskinner_work> I've been a javascript / C# guy for the last few years. Just started using Ruby and my new job a few months ago
<weskinner_work> at my**
<weskinner_work> gotta head out, bbl
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
<asterite> Wow, I'm really amazed that he jumped so fast from ruby to crystal :)
ponga has quit [Ping timeout: 244 seconds]
<jhass> you're amazed by everybody who dares to try the language :P
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 252 seconds]
<asterite> jhass: yes, basically :)
<havenwood> weskinner_work: working great on OS X
* havenwood goes back to playing Tetris.
<asterite> lol :)
ponga has joined #crystal-lang
<weskinner_work> asterite: can y'all move your sdl2 lib to a seperate repo?
<weskinner_work> once you do I'll merge in what I've added to SDL2-Crystal
<asterite> We were going to do it eventually, once we progress with that, but that project is stalled for now
<asterite> You can start that separate repo if you want :)
<weskinner_work> sounds good!
<weskinner_work> havenwood: one of my coworkers is named Shannon Skipper
<weskinner_work> odd
<havenwood> weskinner_work: :O
shama has joined #crystal-lang
ponga has quit [Ping timeout: 272 seconds]
<asterite> Here some politicians have weird last names (in Spanish). Like "Vinegar" and "Curtain"
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 7 new commits to master: http://git.io/xzHo
<crystal-gh> crystal/master c18fee0 Ary Borenszweig: Fixed #457: .class on an integer literal always returns Int32 (lexer bug)
<crystal-gh> crystal/master e4a27b6 Ary Borenszweig: Fixed `class` method for virtual type. This fixes several bugs.
<crystal-gh> crystal/master d009c1a Ary Borenszweig: Raise InvalidByteSequenceError instead of Exception in some methods
<asterite> jhass: with the latest compiler this is fixed https://github.com/manastech/crystal/issues/347 (as well as other class-related issues), but I'll close it once after the next release
<asterite> Now we will be able to show the exception's class name on unhandled exeptions :)
<jhass> cool!
ponga has joined #crystal-lang
asterite has quit [Quit: Leaving.]
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
<travis-ci> manastech/crystal#2070 (master - 228fba9 : Ary Borenszweig): The build is still failing.
ponga has quit [Ping timeout: 244 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/xggB
<crystal-gh> crystal/master c81ef6a Ary Borenszweig: Added `Array#sort` in macros
<crystal-gh> crystal/master c2620e7 Ary Borenszweig: Added `Array#uniq` in macros
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/xgaC
<crystal-gh> crystal/master dfc9cf0 Ary Borenszweig: Don't lookup underscore in block arg
ponga has joined #crystal-lang
DeBot has quit [Quit: Crystal]
DeBot has joined #crystal-lang
<jhass> >> "%x" % 16
<DeBot> jhass: "10"
<jhass> >> raise ArgumentError.new "Foo"
<DeBot> jhass: ArgumentError: Foo
ponga has quit [Ping timeout: 245 seconds]
waj has quit [Quit: Leaving.]
knoopx has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/xg52
<crystal-gh> crystal/master 20455bd Ary Borenszweig: Disabled evented spec in travis for now
asterite has joined #crystal-lang
<travis-ci> manastech/crystal#2071 (master - c2620e7 : Ary Borenszweig): The build is still failing.
asterite has quit [Client Quit]
<travis-ci> manastech/crystal#2072 (master - dfc9cf0 : Ary Borenszweig): The build is still failing.
ponga has joined #crystal-lang
weskinner_work has quit [Ping timeout: 245 seconds]
<travis-ci> manastech/crystal#2073 (master - 20455bd : Ary Borenszweig): The build was fixed.
ponga has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Client Quit]
ponga has joined #crystal-lang
leafybasil has joined #crystal-lang