<ddfreyne>
I hope that in 10 years we have a decent workflow for software development and not a huge list of design and architecture patterns that you can apply in some cases but not all etc
quazimodo has joined #ruby-lang
riotbit has quit [Quit: Lost terminal]
chendo__ has joined #ruby-lang
guns has joined #ruby-lang
Burgestrand has quit [Quit: Burgestrand]
<judofyr>
ddfreyne: hah, you can dream
<ddfreyne>
judofyr: Yeah, I think that is unlikely :)
tsion has quit [Quit: Leaving]
ryanf has left #ruby-lang [#ruby-lang]
<ddfreyne>
I've seen som ehorrible code in my life though
<ddfreyne>
And that code isn't horrible because the developer who wrote it isn't smart enough...
<judofyr>
ddfreyne: that's what happens when you live your life
bzalasky has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 264 seconds]
JohnBat26 has joined #ruby-lang
mbj_ has quit [Quit: leaving]
guns has quit [Quit: guns]
quazimodo has joined #ruby-lang
tonni has quit [Remote host closed the connection]
<judofyr>
charliesome: you can help with improving coverage for the ruby19 parser
<charliesome>
yeah i might
Burgestrand has joined #ruby-lang
<judofyr>
charliesome: that is, writing tests. then I can do the boring part of implementing it :P
<judofyr>
it's basically just copy-pasting from ruby18.y…
<judofyr>
charliesome: see the ruby19-branch. run the tests in Ruby 2.0 and `open coverage/index.html`
<charliesome>
i'll give it a shot
<charliesome>
i don't know a huge amount about ruby syntax
<judofyr>
charliesome: see AST_FORMAT.md for how the AST should be. there's already plenty of tests in test/test_parser.rb that should show you how to structure them
<charliesome>
yeah i was looking at AST_FORMAT
<charliesome>
amazing
<charliesome>
whitequark: serious props for such awesome docos
<mbj>
charliesome: Yeah, the docs are awesome. I remember the times when I tried to debug a problem in RBX parser. Gave up after two unproductive hours.
krz has quit [Quit: krz]
<charliesome>
now i feel bad for never documenting any of my stuff
vlad_starkov has quit [Remote host closed the connection]
krz has joined #ruby-lang
<judofyr>
charliesome: I like how `parser` stores all the line/column-information, so it's simple to do transform while still maintaining the original structure
<mbj>
judofyr: unparser will work the same, but will not need that much crazy foo. Especially as the RBX AST was written with the bytecode structure in mind.
<judofyr>
mbj: is it only going to be like ruby2ruby, or are you going to do funky stuff based on the source_map?
<charliesome>
the ast for methods with blocks seems backwards
Domon has quit [Remote host closed the connection]
<mbj>
charliesome: This is intentionally
<charliesome>
how come?
Domon has joined #ruby-lang
<mbj>
judofyr: to_source is like ruby2ruby but more complete
<mbj>
judofyr: I plan to support structure reproducement in unparser
jxie has joined #ruby-lang
<mbj>
judofyr: But not in the first versions, there I'll focus on generating equivalent source: unparser(parser(source)) == unparser(parser(unparser(parser(source))))
stardiviner has joined #ruby-lang
<mbj>
judofyr: It would be awesome if I can make it source == unparser(parser(source)), but I do not target it in the first versions.
hakunin has joined #ruby-lang
<mbj>
charliesome: From source or bytecode emitter it does not really make a big difference, if you visit node first and than child or child and than node, but whitequark told me it is easier to emit this way with bison/racc
<judofyr>
there's so many projects I want to work on using `parser`: rubytidy (which re-indents and cleans up code), ruby refactoring tool, template language that actually parses the Ruby source too, etc.
<mbj>
judofyr: yeah, I'll use parser for backing mutant (mutation testing tool just like heckle, but better)
maxmanders has quit [Ping timeout: 252 seconds]
<judofyr>
charliesome: it's nicer when the AST is structured outwards and in: ((foo) do end end)
<judofyr>
charliesome: that way every children of a node as a range that is inside the range of the parent
<charliesome>
interesting
<charliesome>
makes sense
yellow5_ has joined #ruby-lang
matthewd has joined #ruby-lang
<charliesome>
yay i found a bug!
jMCg_ has joined #ruby-lang
<mbj>
Also it makes indentation emitting of source many times more easier, this was the most time consuming part in to_source
apeiros has joined #ruby-lang
<judofyr>
charliesome: but yeah, if you want to work on ruby19.y: write tests! I've only fixed it so that the tests pass.
<charliesome>
i'm going to write some failing tests for 18
maxmanders has joined #ruby-lang
<judofyr>
charliesome: hm. what's the bug?
<judofyr>
(I thought 1.8 was quite complete)
<charliesome>
a(&b) emits an ast for a(b)
ubersapiens has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
security is now known as fire
amateurhuman_ has joined #ruby-lang
GitNick has joined #ruby-lang
trollface has joined #ruby-lang
Paradox has quit [*.net *.split]
yellow5 has quit [*.net *.split]
yfeldblum has quit [*.net *.split]
hakunin_ has quit [*.net *.split]
Git|Nick has quit [*.net *.split]
amateurhuman has quit [*.net *.split]
matthewd_ has quit [*.net *.split]
yellow5_ is now known as yellow5
jMCg has quit [*.net *.split]
duckinator has quit [*.net *.split]
cschneid has quit [*.net *.split]
cschneid_ has joined #ruby-lang
duckinator has joined #ruby-lang
yfeldblum has joined #ruby-lang
<charliesome>
so you could use parser to add 2.0 syntax to 1.9
Oloryn_lt2 has joined #ruby-lang
techlife has quit [Ping timeout: 276 seconds]
<judofyr>
charliesome: yeah, when 1.9 is done we should cp ruby{19,20}.y and start porting over the new rules from parse.y
<charliesome>
imagine a gem that overrode require
<charliesome>
and if a file syntax errored, it tried to parse it as ruby 2.0, converted it to ruby 1.9 and tried again
<judofyr>
charliesome: yeah, I've been thinking about various stuff with overriding require. e.g: automatically fix warnings
<judofyr>
so you can run with -w and still disable some warnings
<judofyr>
# :nowarn:
<charliesome>
does anybody actually use -w
<judofyr>
charliesome: I try to run tests on it
Domon has quit [Remote host closed the connection]
<mbj>
wallerdev: You parse this as a dstring node? Why. I like it, but I'm interested.
workmad3 has joined #ruby-lang
<mbj>
wallerdev: sorry, I meant whitequark and he is not in channel so my autocompleate picked you ;)
<mbj>
whitequark: "foo" "bar" is (dstr (str "foo") (str "bar")) and "foo#{1}bar" is (dstr (str "foo") (int 1) (str "bar")), from a too_source point of view this does not really make sense
jxie has quit [Ping timeout: 252 seconds]
<mbj>
whitequark: I'd have to scan a dstr if it acutally contains non string members to emit interpolated or concatenated form.
yalue has joined #ruby-lang
Burgestrand has quit [Quit: Burgestrand]
Guest35746 has quit [Read error: Connection reset by peer]
ged has quit [Read error: Connection reset by peer]
nXqd_ has joined #ruby-lang
<judofyr>
mbj: even worse: "hello#{"world"}" and "hello" "world" has the same AST
<mbj>
whitequark: One could argue: "foo#{1}#{bar}" is equivalent to: "foo" "#{1}" "bar", but maybe we should addd a specialied to_str node, for not having to inspect nodes children? (dstr (str "foo") (to_str (int 1)) (str "bar"))
ged has joined #ruby-lang
<mbj>
judofyr: Yeah, I think "hello" "world" must be concatenated and appear as (str "helloworld")
<mbj>
judofyr: Or we add a specialized (concatstring (str "hello") (str "world"))
<mbj>
judofyr: I'd prefer the latter for unparser ;)
jxie has joined #ruby-lang
KM|2 has joined #ruby-lang
<mbj>
whitequark, judofyr, yorickpeterse: Have to run for a meeting, bbl
Glass_saga has quit [Remote host closed the connection]
Glass_saga has joined #ruby-lang
tonni has quit [Remote host closed the connection]
rippa has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Glass_saga has quit [Remote host closed the connection]
Glass_saga has joined #ruby-lang
tonni has joined #ruby-lang
setmeaway has quit [Ping timeout: 264 seconds]
Swimming_Bird has quit [Ping timeout: 257 seconds]
realDAB has quit [Quit: realDAB]
Swimming_Bird has joined #ruby-lang
Swimming_Bird has quit [Max SendQ exceeded]
Swimming_Bird has joined #ruby-lang
Swimming_Bird has quit [Max SendQ exceeded]
io_syl has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
<whitequark>
omg so much messages in the backlog
<whitequark>
yorickpeterse: lemon is awesome, ++++
yfeldblum has joined #ruby-lang
<whitequark>
also LL recursive descent is the way to go for really good error reporting
<whitequark>
clang's parser is manually written LL RDP
<whitequark>
(refactoring tool) yes, I'm going to add this to parser, I already know how it would be designed
<whitequark>
you'll only rewrite the code you're interested in
<whitequark>
so as not to break unrelated syntax
<whitequark>
parslet is as useless as treetop
<judofyr>
whitequark: you're going to write rubytidy too?
<mbj_>
whitequark: Dont forget the "foo" "bar" vs "foo#{"bar"}" case ;)
<whitequark>
judofyr: I'm going to add a Source::Rewriter and a harness for executing transforms from cmdline
mbj_ is now known as mbj
<whitequark>
everyone disagrees on the code style, write the damn formatter yourself
<whitequark>
it'll be quite simple
<mbj>
whitequark: BTW I started the unparser, will finish it this evening. Only reproducing equivalent not original source, (do not take Source::MAp into account).
<whitequark>
(ast for blocks {}) it's kinda backwards, but it's this way in MRI, PT and RP, and it actually seems that this is somewhat more convenient
<whitequark>
even if it turns out that it isn't, it isn't that much of a problem to warrant a change in AST format
<whitequark>
(it's currently mostly-compatible with RP where RP makes sense)
<whitequark>
(autoeliminate warnings) will be trivial with the rewriter harness
dhruvasagar has quit [Read error: Operation timed out]
<whitequark>
(require & syntax shims) awesome! I have plans for similar tools, too, mainly for SC/CC coverage and not just SC
Glass_saga has quit [Remote host closed the connection]
Glass_saga has joined #ruby-lang
<whitequark>
mbj: (unparser) cool! looking forward to that, I'll have uses for it
<whitequark>
finally the dstr case
<whitequark>
the problem is that I aim to lose no source map info
<whitequark>
otherwise a rewriter could not really exist
<whitequark>
so in the "foo" "bar" I do have to represent them as distinct nodes
nkr has quit [Ping timeout: 264 seconds]
<judofyr>
you could have (cstr) or something
<whitequark>
no, the AST captures semantics
<whitequark>
there is a ton of cases when I represent subtle syntactic differences *just* in source maps
MaddinXx_ has quit [Remote host closed the connection]
<judofyr>
yeah, I agree
<whitequark>
ie to distinguish a a:1 (pair) from :a=> 1 (pair) you'll have to call a method on its source map
<whitequark>
which will proceed to extract the relevant source part (sic) and determine if it's : or =>
<whitequark>
so as to make parsing as fast as possible
<whitequark>
and rewriting, which is much less frequent, slower
<whitequark>
a tradeoff.
<judofyr>
whitequark: I might have gotten charliesome to write ruby19 tests!
<mbj>
whitequark: What about a cstring node dedicated to this source level concatenation? Might also be needed in line continuitations with \
jsaak has quit [Ping timeout: 252 seconds]
nathanstitt has joined #ruby-lang
jsaak has joined #ruby-lang
<whitequark>
judofyr: already merged some
<whitequark>
mbj: no
<whitequark>
1) line continuations are handled before the parser and aren't present in ast
<whitequark>
2) AST is not to contain nodes conveying only source level information
Nisstyre-laptop has joined #ruby-lang
<whitequark>
I don't see how this is a problem for to_source, honestly
<whitequark>
well you do have to iterate the subnodes
<whitequark>
is that a problem?
<whitequark>
mbj: (line continuations) they're transparent in both lexer & parser, btw
<whitequark>
lexer ignores them, parser doesn't see them
<whitequark>
oh crap I think I know of a bug in lexer
<judofyr>
bug: it's over 2000 lines of code…
<whitequark>
"\\\n" at expr_beg
<whitequark>
judofyr: that's an upstream bug ;)
workmad3 has joined #ruby-lang
<judofyr>
whitequark: true
thinkdevcode has joined #ruby-lang
guns has joined #ruby-lang
sush24 has quit [Read error: Connection reset by peer]
gnufied has quit [Quit: Leaving.]
krohrbaugh has quit [Quit: Leaving.]
workmad3 has quit [Ping timeout: 252 seconds]
<mbj>
whitequark: So this is intended behaviour Parser.parse('"foo#{"bar"}"') == Parser.parse('"foo" "bar"') ?
<whitequark>
mbj: within the current specification it is correct.
<whitequark>
I honestly don't see why is this a problem :)
<mbj>
whitequark: okay, so the unparser could emit '"foo#{"bar"}' as '"foo" "bar"', other cases such as '"foo#{1}"' would be unparsed as '"foo" "#{1}"'
guns has quit [Quit: guns]
<mbj>
whitequark: To acutally "collapse" the dstr where possible the unparser needs to do additonal logic, I'm okay with this.
gnufied has joined #ruby-lang
<whitequark>
mbj: hmmm, why the adjacent-concat expansion?
<whitequark>
you can do the dstr expansion?
<whitequark>
though it will be a bit less efficient on mri, addmittedly
<mbj>
whitequark: Forget all my concerns pls, it is easy to implement in the collapsed form.
<mbj>
whitequark: Another idea, what about a special node that encapsulates the "#{}" interpolation?
mossplix has joined #ruby-lang
<whitequark>
mbj: I thought about it
<whitequark>
but I don't quite see the point yet
mossplix has quit [Client Quit]
mossplix has joined #ruby-lang
hramrach has quit [Remote host closed the connection]
hramrach has joined #ruby-lang
stoic_squirrel has joined #ruby-lang
<whitequark>
mbj: well, on the second thought it does capture some semantics
<whitequark>
iirc there's some really shady stuff going on with overloaded #to_str and interpolated strings
<whitequark>
I'd need to consult with rubinius folks
<whitequark>
but I think that "a#{"b"}" is really not equivalent to "a" "b" semantically :(
thinkdevcode has quit [Remote host closed the connection]
JohnBat26 has quit [Ping timeout: 264 seconds]
<ubersapiens>
test
<ubersapiens>
hey guys has anyone here used twitter boostrap?
nXqd has joined #ruby-lang
larryzju has joined #ruby-lang
larryzju has quit [Read error: Connection reset by peer]
larryzju has joined #ruby-lang
krohrbaugh has joined #ruby-lang
Swimming_Bird has quit [Ping timeout: 248 seconds]
larryzju has left #ruby-lang [#ruby-lang]
mytrile has quit [Remote host closed the connection]
nXqd has quit [Ping timeout: 246 seconds]
Swimming_Bird has joined #ruby-lang
Swimming_Bird has quit [Max SendQ exceeded]
thebastl has quit [Remote host closed the connection]
Swimming_Bird has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
krohrbaugh has quit [Ping timeout: 252 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
|Vargas| has quit [Quit: ...]
<mbj>
whitequark: RBX has a ToString node for #{}
tonni has quit [Remote host closed the connection]
<mbj>
whitequark: They concatenate interpolations if they are resolvable on the source level.
<mbj>
whitequark: And dont have a special node for #{}
<whitequark>
mbj: I guess then we don't need to?
tsou has quit [Quit: leaving]
<mbj>
whitequark: Yeah, that ToString is used elsewhere, but I'd love to cover #{} in source maps?
tsou has joined #ruby-lang
<mbj>
whitequark: So it makes sense to include it.
<whitequark>
if you want to check if a certain part of string is an interpolation, you can check the end delimiter of the previous (str) node and begin delimiter of the next one
<whitequark>
hmm
<mbj>
whitequark: Could be an (dstr (str "foo") (interpol (str "bar")))
Gaelan has joined #ruby-lang
<whitequark>
since we already emit distinct (str)s for "a" "b"... well. I think we can make that change
<whitequark>
so (dstr (str "foo") (interp (str "bar")))
<whitequark>
or maybe even "qq", for quasiquoting
<mbj>
hehe
<whitequark>
or, um, "uq"
<whitequark>
unquote, that is
<mbj>
whitequark: yeah
<whitequark>
mbj: can you please add an issue for (uq) then? or even a pull req :)
<mbj>
whitequark: So when we can distinguish between "foo" "bar" and "foo#{"bar"}" we can reproduce better source (for humans)
<mbj>
whitequark: I'll try in the evening!
adambeynon has joined #ruby-lang
<whitequark>
mbj: thanks
Gaelan has quit [Ping timeout: 245 seconds]
<mbj>
whitequark: We have to take all the other dynamic literals into acount, will try to cover these also
<whitequark>
mbj: strings and regexps also
<whitequark>
(%w are an array of strings)
<mbj>
whitequark: also execute strings `echo #{"bar"}`
<whitequark>
yep
Tectonic has joined #ruby-lang
lun_ has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
carloslopes has quit [Remote host closed the connection]
dr_bob has quit [Quit: Leaving.]
glebm has joined #ruby-lang
dingus_khan has joined #ruby-lang
snarfmason has joined #ruby-lang
robbyoconnor has joined #ruby-lang
gregmoreno has joined #ruby-lang
erichmenge has quit [Quit: Arrivederci!]
erichmenge has joined #ruby-lang
ivanoats has joined #ruby-lang
marr has quit [Ping timeout: 252 seconds]
ivanoats has quit [Remote host closed the connection]
ivanoats has joined #ruby-lang
Tectonic has quit []
robbyoconnor has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
krohrbaugh has joined #ruby-lang
<imperator>
i forgot, is there an easy way to compare hash equality while ignoring case for string keys?
pib1999 has quit [Remote host closed the connection]
agile has quit [Quit: Ex-Chat]
swav has joined #ruby-lang
wudofyr has quit [Remote host closed the connection]
wudofyr has joined #ruby-lang
workmad3 has joined #ruby-lang
zastern has joined #ruby-lang
<postmodern>
how do you test respond_to_missing? on 2.0.0, since it's now private
mossplix has quit [Read error: Connection reset by peer]
pib1964 has joined #ruby-lang
<apeiros>
postmodern: I don't think you're supposed to call that yourself
<apeiros>
you call respond_to?, and that will use respond_to_missing? in turn
<postmodern>
apeiros, ah ha
zenspider has joined #ruby-lang
wmoxam has quit [Ping timeout: 245 seconds]
rockets_ has joined #ruby-lang
nathanstitt has quit [Quit: Computer has gone to sleep]
nathanstitt has joined #ruby-lang
zastern has quit [Ping timeout: 245 seconds]
<zenspider>
rawr
krohrbaugh has quit [Quit: Leaving.]
<zenspider>
rking: thanks! fixed!
nathanstitt has quit [Ping timeout: 256 seconds]
mossplix has joined #ruby-lang
krohrbaugh has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
Nisstyre has joined #ruby-lang
wudofyr has quit [Remote host closed the connection]
wudofyr has joined #ruby-lang
alessio_rocco has quit [Remote host closed the connection]
jmeeuwen has quit [Read error: Operation timed out]
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
Wardrop[home] has joined #ruby-lang
nathanstitt has joined #ruby-lang
Averna has joined #ruby-lang
Wardrop[home] has quit [Client Quit]
cored has quit [Quit: leaving]
Wardrop[home] has joined #ruby-lang
ubersapiens has joined #ruby-lang
krohrbaugh1 has joined #ruby-lang
Gaelan has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
seaclay has joined #ruby-lang
<ubersapiens>
guys im taking a ruby course thats implementing sinatra at the moment, to then swtich to rails in a week or so...but i have never done HTML/CSS...any basic tutorial other than that 'grabbing by the hand' codecademy one to learn the backbone of both
<ubersapiens>
thank you in advance
tbuehlmann has quit [Remote host closed the connection]
krohrbaugh1 has quit [Read error: Connection reset by peer]
krohrbaugh has joined #ruby-lang
forrest has quit [Quit: Leaving]
<ubersapiens>
i ask this because the main.rb file links to ERB files which are all written in html
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
yfeldblum has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
breakingthings has quit []
seaclay has left #ruby-lang [#ruby-lang]
seaclay has joined #ruby-lang
seaclay has left #ruby-lang [#ruby-lang]
outoftime has quit [Quit: Leaving]
Gaelan has quit [Remote host closed the connection]
nathanstitt has quit [Quit: Computer has gone to sleep]
nathanstitt has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
mytrile has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
nathanstitt has quit [Ping timeout: 264 seconds]
nathanst1tt has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
workmad3 has quit [Ping timeout: 264 seconds]
Averna has quit [Quit: Leaving.]
Gaelan has joined #ruby-lang
dustint_ has quit [Ping timeout: 240 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<zenspider>
ubersapiens: well... they're written in ERB, which is any old text with embedded ruby in it... but that's just picking nits
mytrile has quit [Ping timeout: 276 seconds]
znz_jp has quit [Quit: kill -QUIT $$]
glebm has joined #ruby-lang
nathanst1tt has quit [Quit: Computer has gone to sleep]
nathanstitt has joined #ruby-lang
znz_jp has joined #ruby-lang
enebo has quit [Quit: enebo]
Gaelan has quit [Remote host closed the connection]
nathanstitt has quit [Ping timeout: 248 seconds]
rockets_ has quit [Remote host closed the connection]
zastern has joined #ruby-lang
znz_v0 has quit [Quit: kill -QUIT $$]
znz_v has joined #ruby-lang
jonahR has quit [Quit: jonahR]
agarie has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mbj has quit [Ping timeout: 245 seconds]
apeiros has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
ubersapiens has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
fragamus has joined #ruby-lang
Wardrop[home] is now known as Wardrop
sailias has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
idkazuma has joined #ruby-lang
<rking>
(Np)
sailias has quit [Quit: Leaving.]
anonymuse has quit [Quit: Leaving...]
matti has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 248 seconds]
krohrbaugh has joined #ruby-lang
robbyoconnor has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]