apeiros changed the topic of #ruby-lang to: Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com
rondale_sc has joined #ruby-lang
<drbrain> wulfgarpro: if you are going to run your tests from `rake` or `ruby -Ilib test/test_my_class.rb` you should require 'minitest/autorun' instead of 'minitest/unit' or 'minitest/spec'
<wulfgarpro> So, I've added: gem "minitest". require "minitest/autorun"
<wulfgarpro> drbrian: I just want to run them from the rb file itself
<drbrain> gem 'minitest' gives you the latest installed version of minitest if you're using rubygems 1.9 (as minitest ships bundled in ruby)
<drbrain> if you're using ruby 2.0.0 and newer you don't need to gem "minitest"
<wulfgarpro> oh ok
<wulfgarpro> I can just use capture_io
<drbrain> minitest/autorun causes the tests to run automatically
<wulfgarpro> drbrian: I see
pskosinski has quit [Ping timeout: 240 seconds]
heftig has quit [Ping timeout: 264 seconds]
<wulfgarpro> drbrian: basically I want to make sure the output from puts is correct in my unit test
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jstorimer has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
andrewvos has quit [Ping timeout: 248 seconds]
CaptainJet_ has joined #ruby-lang
CaptainJet has quit [Disconnected by services]
ledestin has joined #ruby-lang
kgrz has quit [Ping timeout: 252 seconds]
saarinen has joined #ruby-lang
nathanstitt has joined #ruby-lang
kstuart has joined #ruby-lang
benanne has quit [Quit: kbai]
marr has quit [Ping timeout: 256 seconds]
wulfgarpro has quit [Quit: HydraIRC -> http://www.hydrairc.com <- The alternative IRC client]
saarinen has quit [Quit: saarinen]
duph has joined #ruby-lang
GeissT has joined #ruby-lang
saarinen has joined #ruby-lang
duph has quit [Client Quit]
andrewvos has joined #ruby-lang
Asher has joined #ruby-lang
saarinen has quit [Ping timeout: 276 seconds]
GeissT_ has joined #ruby-lang
GeissT has quit [Ping timeout: 256 seconds]
elioat has joined #ruby-lang
_jpb_ has quit [Ping timeout: 248 seconds]
_jpb_ has joined #ruby-lang
duckinatorr has quit [Quit: Nickname collision due to Services enforced nickname change, your nick was overruled]
duph has joined #ruby-lang
elioat has left #ruby-lang [#ruby-lang]
duph has quit [Client Quit]
GeissT_ has quit [Quit: MillBroChat AdIRC User]
duckinator has joined #ruby-lang
rickruby has joined #ruby-lang
amerine has joined #ruby-lang
CaptainJet has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Weems has quit [Ping timeout: 276 seconds]
CaptainJet_ has quit [Ping timeout: 264 seconds]
kgrz has joined #ruby-lang
thepumpkin has quit [Remote host closed the connection]
julweber has joined #ruby-lang
wulfgarpro has joined #ruby-lang
julweber_ has joined #ruby-lang
julweber has quit [Read error: Connection reset by peer]
<wulfgarpro> I'm new to ruby and minitest, my cli application has some calls to exit that cause my unit tests to exit also...
arooni-mobile__ has quit [Ping timeout: 248 seconds]
<wulfgarpro> how can I work around that?
arooni-mobile has quit [Ping timeout: 268 seconds]
kgrz has quit [Ping timeout: 264 seconds]
jstorimer has joined #ruby-lang
wallerdev has joined #ruby-lang
jstorimer has quit [Read error: Connection reset by peer]
r0bby has joined #ruby-lang
arooni-mobile__ has joined #ruby-lang
arooni-mobile has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 252 seconds]
dingus_khan has quit [Remote host closed the connection]
mdedetrich has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby-lang
intellitech has joined #ruby-lang
kgrz has joined #ruby-lang
jackhammer2022 has joined #ruby-lang
kgrz has quit [Ping timeout: 264 seconds]
setmeaway has joined #ruby-lang
mdedetrich has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 248 seconds]
cofin has quit [Quit: cofin]
duph has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
gja has joined #ruby-lang
CaptainJet_ has joined #ruby-lang
CaptainJet has quit [Disconnected by services]
tkuchiki has joined #ruby-lang
rickruby has quit [Remote host closed the connection]
sepp2k1 has quit [Quit: Leaving.]
CaptainJet has joined #ruby-lang
andrewvos has quit [Ping timeout: 256 seconds]
CaptainJet_ has quit [Ping timeout: 276 seconds]
heftig has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
jstorimer has joined #ruby-lang
TheNotary has quit [Quit: Leaving]
gja has quit [Quit: This computer has gone to sleep]
jstorimer has quit [Remote host closed the connection]
jstorimer has joined #ruby-lang
Spaceghost|cloud has joined #ruby-lang
cofin has joined #ruby-lang
andrewvos has joined #ruby-lang
Weems has joined #ruby-lang
CaptainJet_ has joined #ruby-lang
CaptainJet has quit [Disconnected by services]
retro|cz has quit [Ping timeout: 264 seconds]
_jpb_ has quit [Ping timeout: 248 seconds]
_jpb_ has joined #ruby-lang
andrewvos has quit [Ping timeout: 256 seconds]
symm- has quit [Ping timeout: 276 seconds]
arooni-mobile__ has quit [Ping timeout: 276 seconds]
arooni-mobile has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
arooni-mobile__ has joined #ruby-lang
Karql has quit [Ping timeout: 256 seconds]
Karql has joined #ruby-lang
Karql has quit [Read error: Operation timed out]
Karql has joined #ruby-lang
rikai has quit [Read error: Connection reset by peer]
rikai has joined #ruby-lang
julweber_ has quit [Remote host closed the connection]
Karql has quit [Ping timeout: 264 seconds]
Karql has joined #ruby-lang
arooni-mobile has joined #ruby-lang
rickruby has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
sstrickl has quit [Quit: sstrickl]
havenwood has quit [Remote host closed the connection]
swav has joined #ruby-lang
glebm has joined #ruby-lang
glebm has quit [Client Quit]
andrewvos has joined #ruby-lang
rickruby has quit [Remote host closed the connection]
r0bby is now known as robbyoconnor
CaptainJet_ has quit []
CaptainJet has joined #ruby-lang
andrewvos has quit [Ping timeout: 276 seconds]
julweber has joined #ruby-lang
agent_white has joined #ruby-lang
julweber has quit [Ping timeout: 256 seconds]
swav has quit [Ping timeout: 252 seconds]
pkrnj has quit [Ping timeout: 256 seconds]
pkrnj has joined #ruby-lang
vlad_starkov has joined #ruby-lang
pkrnj has quit [Client Quit]
hogeo has joined #ruby-lang
diegoviola has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 276 seconds]
CaptainJet has quit []
hogeo_ has joined #ruby-lang
thebobalu has quit [Ping timeout: 276 seconds]
hogeo has quit [Ping timeout: 248 seconds]
CaptainJet has joined #ruby-lang
cofin has quit [Quit: cofin]
_jpb_ has quit [Ping timeout: 276 seconds]
_jpb_ has joined #ruby-lang
agent_white has quit [Quit: leaving]
_jpb_ has quit [Client Quit]
Karql has quit [Ping timeout: 264 seconds]
_jpb_ has joined #ruby-lang
duph has quit [Quit: Leaving.]
andrewvos has joined #ruby-lang
hogeo_ has quit [Remote host closed the connection]
Karql_ has joined #ruby-lang
<drbrain> wulfgarpro: assert_raises SystemExit do … end
andrewvos has quit [Ping timeout: 256 seconds]
rickruby has joined #ruby-lang
_jpb_ has quit [Ping timeout: 256 seconds]
mdedetrich has quit [Quit: Computer has gone to sleep.]
cofin has joined #ruby-lang
_jpb_ has joined #ruby-lang
matematikaadit has joined #ruby-lang
matematikaadit has left #ruby-lang [#ruby-lang]
mistym has joined #ruby-lang
cofin has quit [Client Quit]
mdedetrich has joined #ruby-lang
kgrz has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
tomzx_mac has quit [Ping timeout: 268 seconds]
wincent has joined #ruby-lang
andrewvos has joined #ruby-lang
stardiviner has quit [Read error: Connection reset by peer]
hhatch has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
stardiviner has joined #ruby-lang
wincent has left #ruby-lang [#ruby-lang]
Nisstyre has quit [Quit: Leaving]
andrewvos has quit [Ping timeout: 276 seconds]
stardiviner_ has joined #ruby-lang
rickruby has quit [Remote host closed the connection]
stardiviner has quit [Remote host closed the connection]
stardiviner_ has quit [Read error: Connection reset by peer]
xxaM has joined #ruby-lang
mdedetrich has joined #ruby-lang
_jpb__ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 276 seconds]
arubin has quit [Quit: Textual IRC Client: www.textualapp.com]
towski has joined #ruby-lang
<erikh> herp
sstrickl has joined #ruby-lang
sstrickl has joined #ruby-lang
sstrickl has quit [Changing host]
kstuart has quit [Ping timeout: 252 seconds]
thebastl has joined #ruby-lang
andrewvos has joined #ruby-lang
scottschecter has quit [Ping timeout: 248 seconds]
diegoviola has quit [Quit: WeeChat 0.4.1]
andrewvos has quit [Ping timeout: 256 seconds]
mistym has quit [Remote host closed the connection]
thebastl has quit [Remote host closed the connection]
llakey_ has quit [Quit: leaving]
llakey has joined #ruby-lang
solars has joined #ruby-lang
gja has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
llakey has quit [Quit: leaving]
llakey has joined #ruby-lang
CaptainJet has quit [Ping timeout: 276 seconds]
sstrickl has quit [Quit: sstrickl]
arooni-mobile__ has quit [Ping timeout: 256 seconds]
arooni-mobile has quit [Ping timeout: 264 seconds]
arooni-mobile__ has joined #ruby-lang
arooni-mobile has joined #ruby-lang
ffio_ has joined #ruby-lang
ffio has quit [Ping timeout: 256 seconds]
wulfgarpro has quit [Read error: Connection reset by peer]
saarinen has joined #ruby-lang
fragamus has joined #ruby-lang
face has joined #ruby-lang
Sambalero has quit [Remote host closed the connection]
jstorimer has quit [Remote host closed the connection]
_jpb__ has quit [Ping timeout: 264 seconds]
saarinen has quit [Ping timeout: 276 seconds]
jMCg_ has joined #ruby-lang
jMCg_ has joined #ruby-lang
jMCg_ has quit [Changing host]
Cope__ has joined #ruby-lang
DefV has joined #ruby-lang
crankhar1er has joined #ruby-lang
hhatch has quit [Ping timeout: 256 seconds]
intellitech_ has joined #ruby-lang
intellitech_ has joined #ruby-lang
intellitech_ has quit [Changing host]
ryotarai_ has joined #ruby-lang
segy_ has joined #ruby-lang
danrabinowitz_ has joined #ruby-lang
intellitech has quit [*.net *.split]
segy has quit [*.net *.split]
yorickpeterse has quit [*.net *.split]
mclee has quit [*.net *.split]
crankharder has quit [*.net *.split]
jMCg has quit [*.net *.split]
DefV_ has quit [*.net *.split]
faces has quit [*.net *.split]
ryotarai has quit [*.net *.split]
danrabinowitz has quit [*.net *.split]
Cope has quit [*.net *.split]
segy_ is now known as segy
intellitech_ is now known as intellitech
jonahR has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
yorickpeterse has joined #ruby-lang
mclee has joined #ruby-lang
matematikaadit has joined #ruby-lang
mistym has joined #ruby-lang
hhatch has joined #ruby-lang
matematikaadit has quit [Quit: used jmIrc]
jstorimer has joined #ruby-lang
jonahR has quit [Quit: jonahR]
zmike has joined #ruby-lang
arooni-mobile has quit [Read error: Operation timed out]
thebastl has joined #ruby-lang
havenwood has joined #ruby-lang
arooni-mobile__ has quit [Ping timeout: 276 seconds]
MartynKeigher has quit [Ping timeout: 245 seconds]
MartynKeigher has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
febuiles has joined #ruby-lang
kgrz has quit [Remote host closed the connection]
<febuiles> What am I missing with strong params in Rails 4 here: https://gist.github.com/febuiles/5942688 ?
<febuiles> I checked the params and it only contains a tweet hash with `body` and `post_at`
<febuiles> woops, thought I was in #rubyonrails, sorry.
towski has quit [Remote host closed the connection]
relix has joined #ruby-lang
towski has joined #ruby-lang
Karql_ has quit [Ping timeout: 276 seconds]
jackhammer2022 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Karql has joined #ruby-lang
Weems has quit [Ping timeout: 276 seconds]
jstorimer has quit [Remote host closed the connection]
towski has quit [Remote host closed the connection]
jonahR has joined #ruby-lang
fragamus has joined #ruby-lang
marr has joined #ruby-lang
vlad_starkov has joined #ruby-lang
Axsuul has joined #ruby-lang
rickruby has joined #ruby-lang
barttenbrinke has joined #ruby-lang
jstorimer has joined #ruby-lang
gja has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Remote host closed the connection]
akurilin has quit [Ping timeout: 264 seconds]
jstorimer has quit [Read error: Connection reset by peer]
Karql has quit [Ping timeout: 248 seconds]
faces has joined #ruby-lang
face has quit [Ping timeout: 252 seconds]
mdedetrich has quit [Quit: Computer has gone to sleep.]
andrewvos has joined #ruby-lang
vlad_starkov has joined #ruby-lang
Karql has joined #ruby-lang
duph has joined #ruby-lang
thebastl_ has joined #ruby-lang
mdedetrich has joined #ruby-lang
thebastl has quit [Read error: Connection reset by peer]
andrewvos has quit [Ping timeout: 256 seconds]
thebastl_ is now known as thebastl
_jpb_ has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
_jpb_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
julweber has joined #ruby-lang
Karql has quit [Read error: Operation timed out]
mdedetrich has quit [Quit: Computer has gone to sleep.]
Karql has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benlovell has joined #ruby-lang
relix has joined #ruby-lang
mdedetrich has joined #ruby-lang
mistym has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
Karql has quit [Ping timeout: 264 seconds]
julweber has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
firstdayonthejob has joined #ruby-lang
jstorimer has joined #ruby-lang
Karql has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
eriklukas has quit [Ping timeout: 276 seconds]
jstorimer has quit [Read error: Connection reset by peer]
toretore has joined #ruby-lang
andrewvos has joined #ruby-lang
swav has joined #ruby-lang
andrewvos has quit [Ping timeout: 248 seconds]
benanne has joined #ruby-lang
charliesome has joined #ruby-lang
benlovell has quit [Ping timeout: 248 seconds]
justinram has joined #ruby-lang
ruurd has joined #ruby-lang
jonahR has quit [Quit: jonahR]
<charliesome> whitequark: ping
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hashkey has quit []
ruurd has quit [Quit: Leaving...]
<whitequark> charliesome: pong
tkuchiki has quit [Remote host closed the connection]
thebastl has quit [Ping timeout: 264 seconds]
<charliesome> whitequark: since you've battled with ruby's parser
relix has joined #ruby-lang
<charliesome> i'd like to ask you something and have you tell me if i'm going down a dangerous path
<charliesome> so slash's lexer and parser are totally separated right
<whitequark> ok
<charliesome> it lexes, then it passes a big array of tokens to the parser
<yorickpeterse> morning nerds
<whitequark> yorickpeterse: moo
<whitequark> charliesome: this is very unusual
<charliesome> i'm thinking of having the parser feed back into the lexer
<charliesome> mainly to support /regex literals/
<whitequark> well, with LL(1) you can at least regain some sanity
<whitequark> but
<whitequark> think about e.g. code highlighting
<whitequark> it has an equivalent of lexer but not parsr
<whitequark> (humans don't have a very good mental parser either.)
<charliesome> ah true
<charliesome> so right now syntax highlighting slash code is fairly trivial
<whitequark> for regex literals, this is usually done by checking for space
<charliesome> coz lexing is totally separated from parsing
<whitequark> \s+/\s+ -> Tk_DIVIDE
<whitequark> \s+/ -> Regex_START
<charliesome> whitequark: in the highlighter?
<whitequark> charliesome: in the lexer
<whitequark> highlighter = lexer.
<charliesome> oh
<whitequark> so if it's adjacent to its rhs, then it's interpreted as a regexp
<charliesome> i dunno if i want my lexer to operate like that
<whitequark> it's way better than having that in parser
<whitequark> besides
<charliesome> what about something like 1/2
<whitequark> how would you solve this in parser?
<whitequark> (1/2) this is usually lexed as 1, /, 2
<whitequark> that is division
<whitequark> for example ruby lexes / this way, more or less
<charliesome> whitequark: but following your suggestion 1/2 would become 1, then unterminated regexp
<whitequark> no
<whitequark> look at \s+ at the start
<whitequark> add a third case... / -> Tk_DIVIDE
<charliesome> >> 1 /2
jstorimer has joined #ruby-lang
<charliesome> fucking bot
<whitequark> hahaha
jstorimer has quit [Read error: Connection reset by peer]
ruurd has joined #ruby-lang
<whitequark> charliesome: but
<whitequark> imagine foo(/bar/)
<charliesome> that's totally unambiguous
<whitequark> yes
<whitequark> you'll also need lexer states to lex it
<whitequark> expr_beg, expr_end.
<charliesome> yeah
<charliesome> so i was thinking of having the parser pass back into the lexer what state it's in
<whitequark> no
eval-in_ has quit [Remote host closed the connection]
<whitequark> make lexer do that
eval-in has joined #ruby-lang
<whitequark> it's way easier to reason about behavior if your lexer does that
<charliesome> that sounds like it's something riddled with edge cases
andrewvos has joined #ruby-lang
<charliesome> where the lexer
<whitequark> it's riddled with edge cases *either way*
<charliesome> where the lexer's behaviour can fall out of sync with the parser
<whitequark> it cannot fall out of sync with parser
<whitequark> because there's nothing to sync
<charliesome> well i mean
<charliesome> say i add some syntax at some point in the parser that means that you're expecting the beginning of an expression at some point
<whitequark> you switch to expr_beg after ([{, and operators. you switch to expr_end after )]} and identifiers
<charliesome> and forget to update the lexer
<whitequark> that's bullshit, sorry
<whitequark> "I can make a bug accidentally and my code won't work"
<whitequark> it's filled with edge cases in any way, but the less context-specific knowledge you have in parser, the better
<charliesome> hm
xxaM has quit [Quit: ZzZz]
<charliesome> you've convinced me
<charliesome> :p
<charliesome> the hard part now is figuring out how to wrangle flex to do what i want
<whitequark> you want to keep both of them as deterministic as it's possible
<whitequark> oh
<whitequark> kill flex
<whitequark> it's not sophisticated enough
<charliesome> reckon i should hand roll a lexer or use another generator?
<whitequark> you could do both
<whitequark> I would take ragel
<charliesome> ah true
<charliesome> does ragel have a state stack?
<whitequark> yes
<charliesome> oh cool
<whitequark> see: fcall command
<whitequark> but the most interesting part of ragel is that it can combine automata for you
<whitequark> basically exposing NFA machinery
tkuchiki has joined #ruby-lang
<whitequark> that's incredibly powerful
<charliesome> whitequark: i'm a noob and i'm not sure what you mean by "combining automata"
<whitequark> charliesome: imagine you have two automata, like "def" and "decompile"
<charliesome> oh right, so ragel can combine the "de"?
<whitequark> yes; and unlike regex engines (some) it doesn't need backtracking
<whitequark> and it can combine literally any automata this way
<whitequark> even with kleene stars
andrewvos has quit [Ping timeout: 256 seconds]
<yorickpeterse> charliesome: did you fucking change something to the eval.in "API"?
<charliesome> yorickpeterse: nope
<charliesome> lol "API"
<yorickpeterse> then why the fuck does my thing suddenly crap out HTML instead of JSON
<yorickpeterse> oh what the hell, that's probably the redirect to the SSL version
<yorickpeterse> ugh
<charliesome> eh weird
<charliesome> ah yeah
<charliesome> that
<yorickpeterse> also fix your SSL
<charliesome> i only have 1 ip address
<yorickpeterse> SNI for whatever reason doesn't work in HTTPClient
<charliesome> yorickpeterse: i'd call that a bug in HTTPClient
<charliesome> you could also turn off hostname verification, that's the proper rubyist solutilon
duph has quit [Quit: Leaving.]
<yorickpeterse> I already did
<yorickpeterse> and I fucking hate doing that
rickruby has quit [Remote host closed the connection]
<whitequark> charliesome: yorickpeterse: get IPv6, you both
<charliesome> whitequark: hmm should do
<charliesome> i've got ipv6 on my home connection
SkyNet has joined #ruby-lang
SkyNet is now known as Guest73785
<yorickpeterse> whitequark: I had IPv6 on my Linode but it served no purpose
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
<charliesome> whitequark: :( my hetzner box doesn't appear to have ipv6
<yorickpeterse> sounds german
<charliesome> yorickpeterse: out of curiosity, what are you using the eval.in api for?
<yorickpeterse> another IRC bot
<charliesome> ah
<charliesome> in what channel(s)
<yorickpeterse> prism-bot (name changes once in a while, previously known as cyberpolice) in #webdevs
<yorickpeterse> btw that channel is not related to webdev at all
rickruby has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
workmad3 has joined #ruby-lang
rickruby has quit [Remote host closed the connection]
pskosinski has joined #ruby-lang
Guest73785 has quit [Remote host closed the connection]
andrewvos has joined #ruby-lang
jstorimer has joined #ruby-lang
jstorimer has quit [Read error: Connection reset by peer]
mdedetrich has quit [Quit: Computer has gone to sleep.]
mdedetrich has joined #ruby-lang
Karql has quit [Ping timeout: 248 seconds]
Karql has joined #ruby-lang
<yorickpeterse> ugh, dependency resolution with Ruby classes
<yorickpeterse> ugggghhh, especially in Rails
<yorickpeterse> the alternative would be some weird proxy object that lazy loads shit but fuck that
<yorickpeterse> ok fuckit, I'm going in
<yorickpeterse> (my cat is asleep so IRC is my rubber duckie atm)
mdedetrich has quit [Quit: Computer has gone to sleep.]
mdedetrich has joined #ruby-lang
rickruby has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mbj has joined #ruby-lang
relix has joined #ruby-lang
relix has quit [Client Quit]
<yorickpeterse> HAHA circular dependencies
<yorickpeterse> ActionController::Metal.superclass # => ActionController::Base
<yorickpeterse> ActionController::Base.superclass # => ActionController::Metal
<yorickpeterse> GREAT
<whitequark> yorickpeterse: LOLWHAT
<whitequark> how is that even possible
<yorickpeterse> I have no idea
<yorickpeterse> but it makes it impossible to create a dependency graph for me
<yorickpeterse> so proxy objects it is
rickruby has quit [Ping timeout: 276 seconds]
<yorickpeterse> oh wait
<yorickpeterse> I misread that
<yorickpeterse> durrrrrrr
<yorickpeterse> it's AbstractController
mdedetrich has quit [Quit: Computer has gone to sleep.]
workmad3 has quit [Read error: Operation timed out]
neurodamage has quit [Ping timeout: 264 seconds]
sstrickl has joined #ruby-lang
sstrickl has joined #ruby-lang
glebm has joined #ruby-lang
soahccc has joined #ruby-lang
nicola has joined #ruby-lang
nicola has quit [Client Quit]
jxweng has joined #ruby-lang
jstorimer has joined #ruby-lang
postmodern has quit [Quit: Leaving]
jstorimer has quit [Read error: Connection reset by peer]
<whitequark> hey hey charliesome
<whitequark> cool idea
<charliesome> whitequark: yo
<whitequark> you know refinements right
Kabaka has quit [Ping timeout: 240 seconds]
<charliesome> whitequark: yup~
<whitequark> I know how to make them 150% sparklier
<charliesome> yorickpeterse: i can show you how to make a recursive dependency graph on 1.9.3-p194 if you like ;)
<charliesome> whitequark: go on?
<whitequark> so. what is a refinement, essentially? (or what it should be?) it is a locally applied, transactional transformation of behavior
<whitequark> what is a class definition? it is a globally applied, non-transactional transformation of behavior
<charliesome> you've lost me
<whitequark> sec
jstorimer has joined #ruby-lang
<whitequark> so, what do you do if you "class A; def foo; end; end" ?
<whitequark> you create a class and then add methods to it, one by one
<charliesome> sure
<whitequark> and the resulting object is globally bound to "A" and you can invoke that methods from everywhere
<whitequark> hence: global, non-transactional
<whitequark> if you fail in the middle of class creation, you have a half-done object
<whitequark> that is not good
<whitequark> *half-done class
<charliesome> ok
<charliesome> ye[
<charliesome> go on
<whitequark> now what is a refinement? it is applied only to a clearly delimited scope (*cough*) and it is transactional; you can't half apply a refinement
<whitequark> so: locally applied, transactional
<charliesome> what if you half create a refinement?
<whitequark> out of scope
<whitequark> you could apply this technique to refinements themselves as well
flip_digits has joined #ruby-lang
jxie has quit [Quit: leaving]
<charliesome> simples
<whitequark> but let's assume for now, there are no such refinements--it will become clear later why this isn't a problem
<whitequark> so
<charliesome> instead of 'refine Klass do … end'
<charliesome> you do
<charliesome> 'm = Module.new do … end; refine Klass do include m end'
<whitequark> let's make original class definition transactional too. "refinement"
<whitequark> this way, classes themselves will be just bags of data
<whitequark> to which you could attach whatever behavior you want
<whitequark> locally and safely
<charliesome> sure
<whitequark> finally the semantics of definition, whether for classes or refinements
<whitequark> whlist in the definition body, you collect a stack of transformations
<whitequark> for ruby that's "define this method"
<whitequark> then apply it as a whole
<whitequark> or store
stardiviner has joined #ruby-lang
neurodamage has joined #ruby-lang
<whitequark> you could also detect conflicts between different stacks of transformations, if your language wants to do that
mdedetrich has joined #ruby-lang
<whitequark> if i ever do refinements in foundry, that's how I will do them
runeb has joined #ruby-lang
<whitequark> charliesome: maybe apply this to slash's oop :)
<charliesome> maybe
<charliesome> i can't see that it would bring much to be table
<charliesome> ruby has threads so maybe transactional class definitions is useful there
<charliesome> slash doesn't
neurodamage has quit [Ping timeout: 264 seconds]
Kabaka has joined #ruby-lang
workmad3 has joined #ruby-lang
jstorimer has quit [Remote host closed the connection]
<apeiros> why'd anybody want python like doc strings in ruby? o0
gja has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
<whitequark> apeiros: why not?
<apeiros> cause they're ugly and don't provide any additional benefit?
sepp2k has joined #ruby-lang
<whitequark> fair enough
<apeiros> at least I don't see any added benefit, hence the question
andrewvos has quit [Ping timeout: 252 seconds]
symm- has joined #ruby-lang
julweber has joined #ruby-lang
jxweng has quit [Quit: Lost terminal]
runeb has quit [Remote host closed the connection]
flip_dig_ has joined #ruby-lang
flip_digits has quit [Quit: flip_digits]
mislav has joined #ruby-lang
scholar01 has quit [Quit: Leaving.]
zmike has quit [Ping timeout: 256 seconds]
madb055 has joined #ruby-lang
swav has quit [Remote host closed the connection]
soahccc has quit [Quit: Legalize it!]
firstdayonthejob has quit [Quit: WeeChat 0.4.1]
jstorimer has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
jstorimer has quit [Read error: Connection reset by peer]
Krimigis has joined #ruby-lang
firstdayonthejob has joined #ruby-lang
zmike has joined #ruby-lang
flip_dig_ has quit [Remote host closed the connection]
flip_digits has joined #ruby-lang
runeb has joined #ruby-lang
neurodamage has joined #ruby-lang
flip_digits has quit [Remote host closed the connection]
flip_digits has joined #ruby-lang
firstdayonthejob has quit [Quit: WeeChat 0.4.1]
cofin has joined #ruby-lang
<apeiros> hm, would you guys say IBAN#to_str is justified? since it can be truly represented by a string…
Cakey has joined #ruby-lang
Weems has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
neurodamage has quit [Ping timeout: 264 seconds]
Weems has quit [Ping timeout: 276 seconds]
runeb has quit [Remote host closed the connection]
MaddinXx_ has quit [Remote host closed the connection]
andrewvos has joined #ruby-lang
_jpb_ has quit [Ping timeout: 252 seconds]
andrewvos has quit [Read error: Operation timed out]
_jpb_ has joined #ruby-lang
<whitequark> IBAN?
<charliesome> whitequark: international banking numbery thingo
<charliesome> apeiros: i'd say no
<charliesome> #to_str is not to be used if something can be represented as a string
neurodamage has joined #ruby-lang
<charliesome> only if it is fundamentally a string, although perhaps not of the T_STRING type
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> gah, he left
<apeiros> an IBAN is fundamentally a string… IMO
julweber has quit [Remote host closed the connection]
<toretore> i disagree, it has structure
<toretore> otherwise, why do you have a separate IBAN type?
MaddinXx has joined #ruby-lang
pskosinski has quit [Quit: Til rivido Idisti!]
_ffio_ has joined #ruby-lang
ffio_ has quit [Ping timeout: 264 seconds]
<apeiros> toretore: string <=> iban is 1:1
<apeiros> and I have a separate IBAN type to provide utilities I wouldn't want to put on string
<apeiros> like generating an iban, validating checksum, format and length etc.
jstorimer has joined #ruby-lang
hogeo has joined #ruby-lang
jstorimer has quit [Read error: Connection reset by peer]
<whitequark> apeiros: type (in ruby): representation + behavior
<whitequark> the representation is that of string, but the behavior isn't
<apeiros> true, if it was, we wouldn't have to_str, no?
<apeiros> since then you'd just have a string straight away
<whitequark> yes
<whitequark> in which cases #to_str matters for you?
<apeiros> i.e., you call to_str if you want string behavior
Weems has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<apeiros> it doesn't really. it's a theoretical question.
<apeiros> I rarely ever see a case where to_str actually makes sense
<apeiros> this one struck me as one where it would
<apeiros> I still don't get why Pathname#to_str was removed, though.
<toretore> the only justification for my position i can come up with is that in my mind an IBAN "isn't a string"
<toretore> it's something i've learnt from many mistakes, to not treat something like something else
<whitequark> apeiros: are all strings valid IBANs?
<apeiros> whitequark: hm. no.
<whitequark> would doing .gsub!(/./, "FOOBAR") return a valid IBAN?
<whitequark> *leave
<apeiros> so 1:1 isn't actually true.
<whitequark> I imagine that only use case for #to_str would be smth like RidiculouslyEfficientCExtensionString
<whitequark> or maybe NetworkedFederatedDecentralized string
<whitequark> (a drb object?)
<whitequark> or a rope implementation
<apeiros> toretore: re "isn't a string" - well, that argument IMO makes little sense, since if it *was* a string, we'd use String class and then to_str wouldn't be needed anyway
<apeiros> whitequark's reasoning makes sense, though
<whitequark> apeiros: see my examples: a rope *is* a string but isn't a String
<apeiros> different implementations for Strings
<apeiros> be that in C or in ruby wouldn't even matter
<apeiros> gap, buffer, rope etc.
<toretore> apeiros: well, if you look at it more closely, an IBAN is a bank identifier, a number and a checksum if i infer correctly?
<whitequark> yeah
vlad_starkov has quit [Ping timeout: 276 seconds]
<toretore> so not like a string at all
<apeiros> toretore: the same a string is characters, is uppercase letters, lowercase letters, yes
<toretore> but an IBAN isn't characters :)
<toretore> only if converted to a string
<apeiros> that's my point, it is a string. no need to convert. it's just not a String string. but as whitequark noticed, not every String string is an IBAN. and that's probably the key.
<toretore> would, for example, the checksum be part of the "string" or would it be calculated when needed?
<apeiros> it's part of the IBAN
<toretore> if i were to have an IBAN type i think i'd calculate it instead of verifying it
vlad_starkov has joined #ruby-lang
<apeiros> you misunderstand
<toretore> so IBAN.new(bank, accno) without checksum
<toretore> i know this isn't part of the original question
<apeiros> the IBAN looks like "CH92 1234 1245 12345 12"
jstorimer has joined #ruby-lang
<apeiros> and the checksum is the digits 92
andrewvos has joined #ruby-lang
<toretore> right
<apeiros> various informations can be extracted from the iban if you know its structure
<apeiros> i.e., if you really want, you don't need an IBAN class at all. you can work off of strings. it's just bad OO then.
<toretore> right, but i'd treat those as separate arguments on creation
<toretore> there's a structure
<apeiros> who says you get them separated?
<toretore> and i'd want to enforce that
<toretore> then you parse it first
<apeiros> in most cases you'll get a complete IBAN. not some decomposed thing.
<toretore> IBAN.parse(str)
<toretore> => anIBAN with separate conponents
<toretore> that's a matter of taste though, i guess
<toretore> the other way may be slighly more efficient
<toretore> but all this is to say that in my head an IBAN is definitely not a string, or similar enough to be considered a string
<toretore> but then again, i've never even thought of using to_str, so i don't know whether that means it shouldn't be used or not
firstdayonthejob has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 252 seconds]
tbuehlmann has joined #ruby-lang
kstuart has joined #ruby-lang
jstorimer has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
workmad3 has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
<apeiros> sorry, had to attend the kitchen
<apeiros> thanks toretore & whitequark for your opinions/rationales
crankhar1er has quit [Quit: leaving]
crankharder has joined #ruby-lang
tdy_ has quit [Quit: WeeChat 0.4.1]
tdy has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
lunarjar has joined #ruby-lang
hashkey has joined #ruby-lang
hashkey is now known as Guest99862
maxmanders has joined #ruby-lang
tbuehlmann has joined #ruby-lang
runeb has joined #ruby-lang
crankharder is now known as crankhar1er
crankhar1er is now known as crankharder
runeb has quit [Ping timeout: 276 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
wallerdev has joined #ruby-lang
Weems has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby-lang
Guest99862 is now known as hashkey
_jpb__ has joined #ruby-lang
Sambalero has joined #ruby-lang
arooni-mobile__ has joined #ruby-lang
jxie has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
kstuart has quit [Ping timeout: 248 seconds]
workmad3 has quit [Read error: Operation timed out]
Cakey has quit [Ping timeout: 248 seconds]
arooni-mobile has joined #ruby-lang
vlad_starkov has joined #ruby-lang
ruurd has joined #ruby-lang
cube526 has joined #ruby-lang
workmad3 has joined #ruby-lang
symm- has quit [Read error: Operation timed out]
vlad_starkov has quit [Ping timeout: 256 seconds]
<yorickpeterse> This weather is so much better once it cools down a bit
<yorickpeterse> During the day if I step outside on my balcony I get an instant sun burn
<yorickpeterse> it's like a one way ticket to looking like a coffee bean
<yorickpeterse> oh..my..god. It all makes sense now. Coffee beans are actually gnomes who went outside and got a very bad sunburn. This makes companies such as Starbucks murderers!
<yorickpeterse> They round up the sun burnt gnomes and turn them into coffee
<yorickpeterse> Ok I'm done
glebm has joined #ruby-lang
lun___ has joined #ruby-lang
cofin has quit [Quit: cofin]
Weems has joined #ruby-lang
<yorickpeterse> whitequark: ping
Weems has quit [Ping timeout: 256 seconds]
<whitequark> yorickpeterse: pong
<yorickpeterse> I think I found another Racc issue
<yorickpeterse> https://github.com/YorickPeterse/ruby-lint/blob/develop/spec/fixtures/complex/slop.rb this file takes forever to parse on Rbx. It does parse it on jruby but the time is considerably longer than on MRI
<yorickpeterse> I however can also notice a slight delay on MRI
<yorickpeterse> Using racc 1.4.9 makes no difference
<yorickpeterse> (instead of whatever Rbx ships)
julweber has joined #ruby-lang
arubin has joined #ruby-lang
tomzx_mac has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
julweber has quit [Remote host closed the connection]
<whitequark> yorickpeterse: oh of course
<whitequark> the cext parser exists for a reason
<whitequark> that reason being: the pure ruby parser is slow as shit
<yorickpeterse> hmpf
<whitequark> the slight delay on MRI is likely due to my lexer being slow
<whitequark> the lexer can be improved considerably by special-casing string literals.
<yorickpeterse> brixen: ping
<whitequark> that is yet to be done though
<whitequark> yorickpeterse: may also want to ruby-prof it
spuk has joined #ruby-lang
spuk has quit [Client Quit]
<yorickpeterse> oh yeah, ruby-lint has lots of areas that could use some serious improvements
<yorickpeterse> but that's for the next release
cube526 has quit [Quit: Bye]
_jpb_ has quit [Remote host closed the connection]
_jpb_ has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<whitequark> yorickpeterse: no, ruby-prof parser over that file
<yorickpeterse> hm
<yorickpeterse> Rbx' memory usage is already sky high :>
<yorickpeterse> (sadly)
<yorickpeterse> it's around 110MB vs around 30MB for MRI
vlad_starkov has joined #ruby-lang
<whitequark> unsurprisingly
Sambalero has quit [Remote host closed the connection]
irmbrady has joined #ruby-lang
<yorickpeterse> that's really the only thing holding me back from seriously pushing Rbx at the moment (more than I already do), the memory usage is just over the top
andrewvos has quit [Ping timeout: 256 seconds]
<yorickpeterse> I'd fix it if I knew why on earth it's doing that
<yorickpeterse> and if I'd had the time
vlad_starkov has quit [Ping timeout: 256 seconds]
<yorickpeterse> hm, I wonder if I can abuse Tracepoint in 2.0 to get some poor-mans-memory profiler
<yorickpeterse> inb4 LOL MEMORY IS CHEAP
<yorickpeterse> 36 seconds to parse slop.rb, ugh
<yorickpeterse> 11 seconds on jruby, including startup time
<yorickpeterse> RBX, YOU WERE THE CHOSEN ONE!!11
<yorickpeterse> though this is probably just Racc being terrible
maxmanders has joined #ruby-lang
workmad3 has joined #ruby-lang
<zzak> \part #yorickquark-lang
<yorickpeterse> :<
benanne has quit [Quit: kbai]
<yorickpeterse> if nobody else is going to talk I will
<whitequark> zzak: you're welcome
<zzak> <3
<yorickpeterse> bah, the Rbx heap dump tool written by evan doesn't work anymore
poga has joined #ruby-lang
<apeiros> why is it that writing the library is only 1/10 of the time, and documenting and testing 9/10s?
vlad_starkov has joined #ruby-lang
<toretore> that's why i don't document or test
<apeiros> maybe it just feels this way, since writing the lib is fun, writing the docs isn't :-/
lun___ has quit [Remote host closed the connection]
lun___ has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
jonahR has joined #ruby-lang
jonahR has quit [Client Quit]
jonahR has joined #ruby-lang
lun___ has quit [Remote host closed the connection]
cofin has joined #ruby-lang
<toretore> apeiros: it does help sometimes though to find inconsistencies or other things i hadn't thought of
<toretore> when something is hard to explain, it's usually because the code is convoluted
_jpb_ has quit [Ping timeout: 264 seconds]
<apeiros> true
<apeiros> same for tests
<apeiros> (yes, I still don't TDD)
_jpb_ has joined #ruby-lang
<toretore> *claps*
<toretore> another free soul
andrewvos has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
irmbrady has quit [Quit: WeeChat 0.4.0]
benlovell has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
scottschecter has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
runeb has joined #ruby-lang
towski has joined #ruby-lang
thebobalu has joined #ruby-lang
<yorickpeterse> whitequark: heh, according to ruby-prof most time is spent in Parser::Lexer#advance
<yorickpeterse> 14.84% apparently
glebm has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
andrewvos has quit [Ping timeout: 276 seconds]
zmike has quit [Quit: ~]
nathanstitt has joined #ruby-lang
havenwood has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
<whitequark> yorickpeterse: unsurprisingly
<whitequark> though that's hardly most
<whitequark> 15%
sush24 has joined #ruby-lang
runeb has quit [Remote host closed the connection]
<yorickpeterse> lets see if I can get some decent readings after patching MRI using the stuff from https://github.com/skaes/rvm-patchsets
<yorickpeterse> kinda makes me wonder why this isn't in MRI out of the box
<yorickpeterse> "./configure: line 19111: SHELL: command not found" uh wtf
_jpb_ has quit [Ping timeout: 248 seconds]
_jpb_ has joined #ruby-lang
ezkl has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
glebm has joined #ruby-lang
<apeiros> :( newer ruby kills my test/unit hack
lun___ has joined #ruby-lang
towski has quit [Remote host closed the connection]
andrewvos has joined #ruby-lang
skade has joined #ruby-lang
mreq has joined #ruby-lang
poga has quit [Remote host closed the connection]
<mreq> Is there a way how to get less-css version 1.4 via ruby? The official gem leads to 1.3.3
<yorickpeterse> they moved over to a Node.js package I believe
<mreq> while the node version is 1.4 - http://pastebin.com/r41fmVFZ
<mreq> yes they did, I don't know whether I can "hack" middleman or any other engine to use the node.js one
carlosdo has joined #ruby-lang
benlovell has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby-lang
mislav_ has joined #ruby-lang
andrewvos has quit [Ping timeout: 264 seconds]
mislav has quit [Ping timeout: 248 seconds]
fragamus has quit [Quit: Computer has gone to sleep.]
pipework has quit [Remote host closed the connection]
pipework has joined #ruby-lang
maxmanders has joined #ruby-lang
spuk has joined #ruby-lang
akurilin has joined #ruby-lang
Nilium has joined #ruby-lang
ahmdrefat has joined #ruby-lang
ahmdrefat has quit [Remote host closed the connection]
<yorickpeterse> ugh ,getting these patches to work on MRI is harder than I hoped for
<yorickpeterse> but! It might just work
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
_jpb__ has quit [Ping timeout: 248 seconds]
thebobalu has quit [Ping timeout: 276 seconds]
MartynKeigher has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
MartynKeigher has joined #ruby-lang
<yorickpeterse> weeee it works
<yorickpeterse> boooooh, ruby-prof still reports NaN for values
<yorickpeterse> oh, had to recompile it
<yorickpeterse> durr
mreq has quit [Ping timeout: 276 seconds]
mistym has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 256 seconds]
ruurd has quit [Quit: Leaving...]
mistym has quit [Read error: Connection reset by peer]
mistym has joined #ruby-lang
<Nilium> Kind of surprised how easy it is to write C extensions.
<Nilium> Not nearly as terrible as I expected.
Nisstyre has joined #ruby-lang
_jpb_ has quit [Read error: Connection reset by peer]
_jpb_ has joined #ruby-lang
thebastl has joined #ruby-lang
erikgj has joined #ruby-lang
andrewvos has joined #ruby-lang
ruurd has joined #ruby-lang
andrewvos has quit [Ping timeout: 256 seconds]
thebastl has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
firstdayonthejob has quit [Quit: WeeChat 0.4.1]
erikgj has quit [Remote host closed the connection]
erikgj has joined #ruby-lang
benlovell has joined #ruby-lang
erikgj has quit [Client Quit]
thebastl has joined #ruby-lang
tkuchiki has joined #ruby-lang
benanne has joined #ruby-lang
tkuchiki has quit [Ping timeout: 248 seconds]
<yorickpeterse> http://hastebin.com/kumepedine.css well I think that gives a clear picture
<yorickpeterse> (that's GC time)
benlovell has quit [Ping timeout: 256 seconds]
<yorickpeterse> Note to self: keep using FOO = {}.freeze, it's better than def foo; {}; end; (doh)
mreq has joined #ruby-lang
jonahR has quit [Ping timeout: 256 seconds]
Squarepy has joined #ruby-lang
jonahR has joined #ruby-lang
havenwood has joined #ruby-lang
CaptainJet has joined #ruby-lang
<apeiros> blerp, released iso-iban.gem
* yorickpeterse tried to go to rubgems.org
<yorickpeterse> not sure what's behind that domain. Not trying either
glebm_ has joined #ruby-lang
sepp2k1 has joined #ruby-lang
glebm has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 276 seconds]
<darix> apeiros: so next stop a complete swift library?:p
<yorickpeterse> famous last words before apeiros was never seen again
<yorickpeterse> 5 years from now there will be "apeiros day" where everybody is forced to deal with Swift
<yorickpeterse> for an entire day
mbj has quit [Ping timeout: 264 seconds]
<darix> yorickpeterse: well ... given the rules of the swift network... I would emphasize the "no liabilities" part of the license. :)
<apeiros> darix: aaahaha, no
<apeiros> unless we need that at my company
<apeiros> that said: swifts "machine readable files" suck.
<apeiros> inconsistent stupid crap.
<darix> apeiros: and if you format your file incorrectly you pay the amount as fine. :)
<apeiros> at least better than parsing their pdf (which I did before stumbling over the tab file)
<apeiros> what?
<darix> incorrectly formated swift messages -> pay amount in the message as fine.
<darix> in general after seeing some talks about formats used in banking to describe products and stuff. i hope i can stay far away from that.
mislav_ has quit [Ping timeout: 276 seconds]
<apeiros> eeerp :D
<apeiros> I hope they provide tools for verifying your messages?
relix has joined #ruby-lang
<Nilium> It's really nice being able to use OpenGL in Ruby. Not sane, but nice.
<yorickpeterse> holy shit
<yorickpeterse> if I read this right this one method allocates 16478 objects
<yorickpeterse> 16478 Hash objects that is
<yorickpeterse> that's quite a bit
<Nilium> O_o
<yorickpeterse> good thing I know how to fix it
<yorickpeterse> but first I need more numbers to confirm it
<whitequark> yorickpeterse: what is dat
<yorickpeterse> gets called in #initialize for every new object
<yorickpeterse> not sure if a `DEFAULT = {...}.freeze` + a dup would solve that though
<yorickpeterse> you'd effectively do the same thing
<whitequark> dup is shallow
<whitequark> also: gvar?
<whitequark> make the @definitions hash lazily create its constituents
<yorickpeterse> doubt that would make a big difference, all of that is actually used
<whitequark> all of your methods allocate gvars?
<whitequark> same for constants, etc
<yorickpeterse> No, but they could be
<yorickpeterse> and constants are actually very often used
<yorickpeterse> (note that this is just a data container, it's also used for the global scope)
<whitequark> what do you even *need* that for
<yorickpeterse> everything
<whitequark> to be honest
<whitequark> I never really understood why the ruby-lint architecture looks like it does
<whitequark> and I think it's pretty dumb in multitude of ways
<yorickpeterse> well, you haven't been working on it for well over a year :)
<whitequark> I wrote three or four partial evaluators
<yorickpeterse> And given the lack of understanding I'd say it's hard to form the opinion "it looks dumb"
<yorickpeterse> (as in, understanding of ruby-lint)
andrewvos has joined #ruby-lang
<whitequark> I don't particularly care how exactly it works; I see that it is much more complex and convoluted than needed.
<yorickpeterse> This is by no means *the* way to do it, but it has so far been a very pleasant one
<whitequark> what you need for your linting is a partial evaluator
<whitequark> what you wrote *is* a partial symbolic evaluator
<whitequark> but it's strange and opaque
<yorickpeterse> how so?
<whitequark> for example this ruby-object class
<whitequark> why is @definitions a collection of objects of basically every kind there is in ruby?
<whitequark> gvars only belong to global scope; constants to Modules; and so on
<yorickpeterse> As mentioned above, it's a generic data container used for basically everything
<yorickpeterse> as in
<whitequark> all these entities behave in radically different ways but you group them together
<yorickpeterse> The global scope object is an instance of RubyObject
<yorickpeterse> but so is a class
<whitequark> and why does this make sense?
<whitequark> scopes aren't classes
<yorickpeterse> because they all work almost identical for my use case
<whitequark> classes aren't methods
eriklukas has joined #ruby-lang
<yorickpeterse> No offence, but read up on the architecture and look at what it does
<yorickpeterse> it takes some digesting but it's not exactly rocket science
<yorickpeterse> Though I do need to write a proper page on how/what/etc
<yorickpeterse> (now that things have stabilized/matured for the most part)
<whitequark> how do I phrase it
<yorickpeterse> phrase what?
<whitequark> I know how Ruby works. a good partial evaluator for Ruby must follow Ruby's structure and semantics
<yorickpeterse> and it does?
andrewvos has quit [Ping timeout: 246 seconds]
<whitequark> I don't see it
<yorickpeterse> You looked at one file
<yorickpeterse> It's not exactly a project that makes sense by looking at maybe a handful of files
<whitequark> that's not correct
<yorickpeterse> Having said that, most of the reasoning and such is written down on paper and not in some Markdown file, that could be improved
<yorickpeterse> whitequark: I'm pretty sure it is, considering I wrote it and no single file defines the entire project
<whitequark> in the similar vein, why the hell each single argument is modelled by *two* RubyObjects
<yorickpeterse> old cruf
<yorickpeterse> * cruft
<yorickpeterse> I used to name things by their human friendly verison back when using Ripper
<yorickpeterse> haven't really bothered getting rid of those argument "aliases" yet
<yorickpeterse> e.g. :const used to be :constant, :gvar used to be :global_variable, etc
<yorickpeterse> either way, this project is the result of my twisted mind going nuts on the keyboard but I can assure you that there are actually good reasons behind most lines of code
<whitequark> yorickpeterse: well, let's say I am only talking about your partial evaluator
<whitequark> other parts, I'm not interested in, and besides that they seem to make sense
<yorickpeterse> Go on
<whitequark> the stuff I already said about it still applies. I will now read up the parts of code which I didn't seem, and be more specific
<whitequark> unrelated: lol, representing amount of arguments by floating point
<yorickpeterse> wat
<whitequark> ArgumentAmount
<Nilium> Sounds like a Javascriptism
<whitequark> Nilium: I believe it's harmless in this case
<whitequark> but still funny
<yorickpeterse> whitequark: wait, you mean in ruby-lint or in Ruby itself?
<Nilium> Probably harmless, just weird.
<yorickpeterse> If the former, then I must've been terribly drunk
<whitequark> yorickpeterse: ruby-lint. ArgumentAmount analysis class
<yorickpeterse> lets see
<yorickpeterse> oh that
<whitequark> that being said your overall analysis architecture seems good overall
<yorickpeterse> ha, that's the result of "Fuckit, this is easy"
<yorickpeterse> Otherwise you'd end up with an extra else clause in case you'd have an infinite amount of args
<x0f> whitequark: nullary, halfary, quatary ;)
<yorickpeterse> Since X is always < Float::INFINITY this was easier
<Nilium> I need to find a way to document things without doing it inline with source using rdoc or yard. Time for fun!
<whitequark> Nilium: why would you want that
<Nilium> C extensions that rdoc is unable to parse.
<Nilium> On a tangentially related note, rdoc has terrible documentation.
<yorickpeterse> whitequark: tbh if somebody were to spend some time reading on RubyLint::VirtualMachine they'd probably think I was doing crystal meth, cocaine and catnip at the same time
<yorickpeterse> then again it used to be worse
<yorickpeterse> (the code, not the drugs)
erikgj has joined #ruby-lang
<Nilium> Could just do both.
<whitequark> haha, definitions/core/
<yorickpeterse> Hmpf, so this is where ruby-prof's output is confusing: 175 kb allocated and 1018 calls. Does that mean 175 per call or 175 for the total amount
<whitequark> you would likely go insane writing that by hand
<yorickpeterse> whitequark: I don't
<yorickpeterse> It's pre-generated
<yorickpeterse> using a Rake task
<whitequark> I know
<whitequark> I suggested you a way to generate it, dude
mbj has joined #ruby-lang
<yorickpeterse> though I made some manual changes to deal with Ruby's recursive deps
<whitequark> which I think you ultimately followed
<yorickpeterse> Generating that stuff for Rails outputs all kinds of DEPRECATION: warnings
<whitequark> >return (filename <=> other.filename) <=> (other.level <=> level)
<whitequark> wat
<yorickpeterse> since Rails somehow hijacks const_get/const_defined? with some other weird shit
<whitequark> alien invasion
<yorickpeterse> whitequark: sorts by filename, then by error level
<yorickpeterse> but yeah, dem spaceships
<Nilium> My understanding is just that Rails does lots of horrifying things.
pipework has quit [Quit: Fucking off to play League of Legends :(]
<yorickpeterse> it does
mislav has joined #ruby-lang
<whitequark> yorickpeterse: NestedStack
<whitequark> hint: environments are implemented by a chain of lookup tables
<whitequark> it's a) easier b) saner c) more efficient
<yorickpeterse> eh?
<yorickpeterse> What environments?
<whitequark> aka scopes
<yorickpeterse> and "a chain of lookup tables" is basically what RubyObject is
arooni-mobile has quit [Ping timeout: 248 seconds]
arooni-mobile__ has quit [Ping timeout: 256 seconds]
carlosdo has quit [Quit: Linkinus - http://linkinus.com]
<yorickpeterse> I could probably fill an entire book with the ins and outs
<whitequark> VM#freeze isn't good enough... look up gem ice_nine
<yorickpeterse> hmmm
<yorickpeterse> hm, this looks interesting
<Nilium> That'd actually be a fairly interesting book. Probably.
lun___ has quit [Read error: Connection reset by peer]
lun___ has joined #ruby-lang
<yorickpeterse> It would need one of those wacky book covers, otherwise it wouldn't fit me
<Nilium> Giant scary crayon-drawn doll?
<yorickpeterse> heh
<Nilium> Reminds me, need to see if Programming Pearls is affordable yet..
<yorickpeterse> "Ruby on Crack" would be a decent title
<whitequark> yorickpeterse: I read all of the relevant sources
<whitequark> I firmly stand by my position
<yorickpeterse> heh
<yorickpeterse> Didn't expect otherwise tbh
<Nilium> Ruby on Crack: You Gazed Into The Abyss
<whitequark> RubyObject is a typical case of hasheritis... the object which is responsible for doing everything, whether that makes sense or not
<Nilium> Every five pages is a hand flipping you off just to make sure only masochistic people read it.
<yorickpeterse> Actually I went back to two (well 3 now) classes instead of dedicated ones
<yorickpeterse> the latter didn't work at all
<whitequark> and the VirtualMachine is just a very strange design... it looks like a bytecode machine yet it iterates over AST
<whitequark> it doesn't make sense to do *both*. you need bytecode because it's compact and is faster to traverse than AST, not because it's more convenient--it isn't
<whitequark> yorickpeterse: I could suggest better alternatives
<yorickpeterse> Oh believe me, I looked into bytecode
<whitequark> I remember that you did.
<yorickpeterse> this is one of those areas where I should really document the "why the fuck did you do that>"
<yorickpeterse> * ?
<whitequark> yorickpeterse: but to suggest them, I need to know more about the information you want to collect
<whitequark> yorickpeterse: documenting your solution is always a good thing, but I'm more interested in intent here
<yorickpeterse> That's part of what would be documented
nathanstitt has quit [Quit: I growing sleepy]
<yorickpeterse> not just "This is how you ride a bike" but also "This is how you ride a bike and *why* you ride it this way"
<yorickpeterse> But that's something I'll do in the next two releases
hhatch has quit [Ping timeout: 276 seconds]
<whitequark> yorickpeterse: can you explain in a few words, now, what information do you want to collect from your partial executions?
mistym has quit [Remote host closed the connection]
<whitequark> because that pretty much shapes your VM design and data structures
skmp has joined #ruby-lang
postmodern has joined #ruby-lang
MartynKeigher has quit [Read error: Operation timed out]
<yorickpeterse> Primarily definitions (variables, methods, etc) and the calling of methods (primarily to get some extra info such as when modules are included).
<yorickpeterse> The second thing is that it prepares the various scopes to make the life of the analysis classes a hell of a lot easier
<yorickpeterse> Up to the point where they can say "Give me the scope of AST node X please" and bam, there you go
<yorickpeterse> Previously they had to do a lot of the work themselves, which was extremely painful and buggy
MartynKeigher has joined #ruby-lang
<yorickpeterse> ("a few words")
<yorickpeterse> It's however designed to deal with the case of "I want more info, I don't want to rewrite things" if that makes sense
<whitequark> it's an analysis utility. of course
<whitequark> ok. I was somewhat wrong when I said that the information you want to collect shapes your VM design and data structures
<whitequark> it does
<whitequark> but the primary cause is the analysis passes you want to run
<whitequark> so: which are they?
MartynKeigher has quit [Remote host closed the connection]
thebastl has quit [Remote host closed the connection]
Squarepy has quit [Quit: Leaving]
<yorickpeterse> "As much as I deem interesting" would be the best answer. Right now it does most of what MRI's -W2 does + method call validation
<yorickpeterse> But I want more complex things such as thread safety analysis (not sure up to what point that's possible) for example
<yorickpeterse> detecting recursion would also be nice, but I'd have to implement call graphs first for that
jonahR has quit [Quit: jonahR]
<whitequark> ok
<whitequark> got it
<whitequark> let's discuss it later; I have work to do
* whitequark goes back to writing ocaml
<yorickpeterse> heh
MartynKeigher has joined #ruby-lang
<yorickpeterse> String#split causes 54668 allocations. Fack.
tommylommykins has joined #ruby-lang
<yorickpeterse> Hm, Module#module_eval is also called an awful lot
<yorickpeterse> Does that get triggered when you call a block?
<yorickpeterse> It has to be, since I don't call that method explicitly
<whitequark> no
<whitequark> well, not in general case
<yorickpeterse> hmmm
erikgj has quit [Quit: erikgj]
tonni has quit [Remote host closed the connection]
tonni has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
voip_engineer has joined #ruby-lang
jperry has quit [Read error: Connection reset by peer]
jperry has joined #ruby-lang
_jpb_ has quit [Ping timeout: 246 seconds]
_jpb_ has joined #ruby-lang
cofin has quit [Quit: cofin]
firstdayonthejob has joined #ruby-lang
mistym has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
cofin has joined #ruby-lang
tommylommykins has quit [Remote host closed the connection]
fenicks has quit [Remote host closed the connection]
<yorickpeterse> lel, saved myself 20k allocations which in turn only saves me 1MB
gregf has quit [Quit: WeeChat 0.4.1]
enebo has joined #ruby-lang
<yorickpeterse> whitequark: regarding that module_eval stuff, that's Parser
<whitequark> oh, that would be racc
<whitequark> it uses module_eval with file,line for error reporting in reduction rules
<yorickpeterse> heh
<yorickpeterse> it calls it *a lot*
<yorickpeterse> 417 times according to TracePoint
<whitequark> it calls it once per rule
<whitequark> yes
<yorickpeterse> heh
<whitequark> one-time cost though
<yorickpeterse> well
x0f_ has joined #ruby-lang
<yorickpeterse> it does trigger 17930 allocations according to ruby-prof
<yorickpeterse> 2.1 MB, which isn't that bad
tomzx_mac has quit [Read error: Operation timed out]
<whitequark> it?
<whitequark> 17k allocations is not that much
andrewvos has joined #ruby-lang
x0f has quit [Ping timeout: 264 seconds]
<yorickpeterse> on a sidenote, these ruby-prof numbers are a bit confusing at times
benanne has quit [Quit: kbai]
MaddinXx has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
andrewvos has quit [Ping timeout: 256 seconds]
enebo has quit [Quit: enebo]
mistym has quit [Remote host closed the connection]
eriklukas has quit [Ping timeout: 276 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
mdedetrich has joined #ruby-lang
pskosinski has joined #ruby-lang
febuiles has quit [Quit: febuiles]
nathanstitt has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
levifig has joined #ruby-lang
skmp has quit [Quit: Leaving.]
_jpb_ has quit [Ping timeout: 240 seconds]
_jpb_ has joined #ruby-lang
spuk has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
julweber has joined #ruby-lang
_ffio_ has quit [Ping timeout: 264 seconds]
ffio has joined #ruby-lang
jstorimer has joined #ruby-lang
jstorimer has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
workmad3 has quit [Ping timeout: 276 seconds]
<whitequark> heh. not sure if ocaml is very bad or very good
pskosinski has quit [Remote host closed the connection]
<whitequark> very bad: no unicode at all in the standard library or language; worse, it's explicitly latin-1
<whitequark> very good: I implemented utf-8 support in about 1.5 hours with just the standard tools
pskosinski has joined #ruby-lang
andrewvos has joined #ruby-lang
nathanstitt has joined #ruby-lang
<Nilium> I really hate rdoc.
solars has quit [Ping timeout: 264 seconds]
jstorimer has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
jstorimer has quit [Remote host closed the connection]
pskosinski_ has joined #ruby-lang
pskosinski has quit [Remote host closed the connection]
pskosinski_ is now known as pskosinski
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
tommylommykins has joined #ruby-lang
Sambalero has joined #ruby-lang
justinram has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
Zer_0 has joined #ruby-lang
<Zer_0> anyone knows how to find a file's encoding with ruby ?
duph has joined #ruby-lang
<drbrain> Zer_0: you have to know it in advance from file the file format or out-of-band information
<drbrain> … unless it has a Unicode BOM
<whitequark> drbrain: in the general case that doesn't guarantee anything
<whitequark> could be binary.
<drbrain> yeah
<drbrain> that assumes you know you're reading a text file
nathanstitt has quit [Quit: I growing sleepy]
<Zer_0> what i want is to receive a .srt file and do some changes to that file
<Zer_0> but i don't know the encoding of the file
<whitequark> Zer_0: then you can't do that
<whitequark> there is no generic way to determine a file encoding
<Zer_0> okok , thanks ^^
<whitequark> there's always a chance (and it's practical) that you will just break it
<whitequark> without even knowing it
vlad_starkov has joined #ruby-lang
<Zer_0> with some exception handling i can cover the most common ones :)
<whitequark> you can't... you don't know if it is, for example, iso-8859-1 or -8859-3
<whitequark> this is just the simplest of clashes
erikgj has joined #ruby-lang
<whitequark> then again: if you load/save it as binary, and stick to 7-bit sequences while editing, you can preserve practically every important encoding
marr has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Ping timeout: 246 seconds]
andrewvos has quit [Ping timeout: 276 seconds]
Sambalero has quit [Remote host closed the connection]
hogeo has joined #ruby-lang
<Zer_0> whitequark, ty
eriklukas has joined #ruby-lang
Zer_0 has quit [Quit: Leaving]
Sambalero has joined #ruby-lang
fosky has joined #ruby-lang
jstorimer has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
Sambalero has quit [Ping timeout: 256 seconds]
cofin has quit [Quit: cofin]
hagabaka has quit [Read error: Connection reset by peer]
hagabaka has joined #ruby-lang
pskosinski has quit [Ping timeout: 240 seconds]
pskosinski has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rickruby has joined #ruby-lang
swav has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
toretore has quit [Quit: Leaving]
jackhammer2022 has joined #ruby-lang
<drbrain> ↑ yes
cofin has joined #ruby-lang
jstorimer has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
<whitequark> he quit...
tomzx_mac has joined #ruby-lang