<xybre>
So. Even when having written your own `foo=` methods Ruby will always insist on returning the value on the right, not the actual value returned by the block.
<xybre>
s/block/method
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
<lianj>
you could use send
imperator has quit [Quit: Valete!]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
<xybre>
You're right, send does work. But it defeats the usefullness of the nice syntax the setters provide. So I need to have a set_foo as well as a foo= method.
<lianj>
expecting foo = :bar to return something other than :bar is strange anyway
nneko001__ has joined #ruby-lang
arBmind has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
<xybre>
I want it to return the properly formatted object. Like path = "/foo" #=> #<Pathname:/foo>
<erikh>
assignment doesn't work like htat. you have to use a different operator
<erikh>
for variables at least.
jsullivandigs has quit [Ping timeout: 276 seconds]
pkrnj has quit [Ping timeout: 246 seconds]
<xybre>
I know it doesn't, thats why I am complaining :)
corundum has quit [Ping timeout: 245 seconds]
mootpointer has quit [Ping timeout: 256 seconds]
rue has joined #ruby-lang
<NemesisD>
anyone, regarding the GC question?
roadt has quit [Read error: Connection reset by peer]
pkrnj has joined #ruby-lang
roadt has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
rikai_ is now known as rikai
dhruvasagar has joined #ruby-lang
iliketur_ has joined #ruby-lang
lightcap has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 276 seconds]
robbyoconnor has quit [Ping timeout: 248 seconds]
robbyoconnor has joined #ruby-lang
GeissT_ has joined #ruby-lang
GeissT_ has quit [Client Quit]
iliketur_ has quit [Ping timeout: 246 seconds]
levifig has joined #ruby-lang
NemesisD has quit [Quit: WeeChat 0.4.1]
GeissT has quit [Ping timeout: 240 seconds]
robbyoconnor has quit [Ping timeout: 246 seconds]
NemesisD has joined #ruby-lang
robbyoconnor has joined #ruby-lang
ericwood has left #ruby-lang [#ruby-lang]
ericwood has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bungoman has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 264 seconds]
macmartine has joined #ruby-lang
bondar has joined #ruby-lang
richardburton has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
<charliesome>
NemesisD: still looking for an answer?
<charliesome>
basically ruby *will* try and release memory back to the OS when it can, but often it can't
<charliesome>
on most x86 systems, the OS can only give memory to ruby in 4 KB blocks
<charliesome>
ruby can only release those 4 KB blocks back when nothing is using it
<charliesome>
the problem is ruby's GC is non moving
<charliesome>
so if you allocate an object, it will always live at that location in memory until it's freed
<charliesome>
so if you have a single object sitting somewhere inside that 4 KB, that prevents the block of memory being release
headius has quit [Quit: headius]
<ericwood>
charliesome: that was enlightening, thanks :)
diegoviola has quit [Ping timeout: 246 seconds]
apeiros has quit [Remote host closed the connection]
JohnBat26 has joined #ruby-lang
richardburton has left #ruby-lang [#ruby-lang]
macmartine has quit [Quit: Computer has gone to sleep.]
<NemesisD>
charliesome: so its a granularity issue? there may be multiple objects that either span multiple allocations or objects still being used in the same OS memory block?
<charliesome>
NemesisD: ruby objects are always 40 bytes on a 64 bit system
<charliesome>
so the 4 kb blocks of memory are divvied up into slots
robbyoconnor has joined #ruby-lang
<charliesome>
but yeah, that presents a problem where you have a 40 byte object sitting in the middle of a 4 kb block
<charliesome>
and ruby can't release just parts of 1 4 kb block back to the OS
Domon has joined #ruby-lang
<charliesome>
it has to release the whole lot
<NemesisD>
ah i've been told this is an issue of compaction
<NemesisD>
why does ruby not compact
tonni has joined #ruby-lang
<sluukkonen>
C extensions
<charliesome>
c extensions are passed direct pointers to ruby objects
<charliesome>
so they can't be moved in memory because of that
<NemesisD>
is that unsolvable?
<sluukkonen>
you'd have to change the c extension api, which would break a lot of code
<sluukkonen>
I don't see it happening
<NemesisD>
so this situation we find ourselves in is historical?
<NemesisD>
mistakes were made in the c api early on and now its too expensive to change?
dhruvasagar has quit [Read error: Connection reset by peer]
<charliesome>
C extensions are probably the biggest thing stopping CRuby moving forward
<jrobeson>
:(
<ericwood>
:'(
<NemesisD>
sad times
<ericwood>
i sad now
<jrobeson>
sad ericwood smash
dhruvasagar has quit [Read error: Connection reset by peer]
<NemesisD>
because when i think about it: ruby's majority use case these days seems to be the web, which entails long running processes in memory-constrained environments
<NemesisD>
seems like in that case the interpreter is underserving the primary use case of the language
<jrobeson>
NemesisD, i wouldn't say memory constrained so much
dhruvasagar has joined #ruby-lang
<jrobeson>
but people do often choose to use jruby
<NemesisD>
jrobeson: memory is one of my primary concerns with deployment and devops
<jrobeson>
have you considered the alternatives ( i haven't yet)
<jrobeson>
like rubinus ? or jruby?
<ericwood>
running JRuby here to a great degree of success
<NemesisD>
my rails processes on one of my apps kills itself with SIGUSR1 when it exceeds a certain amount of memory
<NemesisD>
we don't have the manpower or expertise right now to switch our main apps to jruby
<NemesisD>
i've got only 1 project in production with jruby and I hate it but that's mostly because it uses hbase and has to deal with a bunch of crappy broken jruby gems
<NemesisD>
jruby itself seems quality other than startup time
<ericwood>
it has real threads!
<jrobeson>
well as you said. long running processes
<NemesisD>
yes but unfortunately that doesn't make all the libraries you use threadsafe, especially when they've been written in a predominantly cruby culture which leans on the GIL
<jrobeson>
so startup time shouldnt matter too much
ylluminate has quit [Read error: Connection reset by peer]
<NemesisD>
jrobeson: yeah its just a pain for development
<jrobeson>
ah legacy stuff is no fun
<ericwood>
it is
<jrobeson>
because of the libraries ? or just generally?
<ericwood>
I would kill to have MRI back for the dev environment for my company's app :\
<NemesisD>
jrobeson: the slow startup time is a pain for fast test suites
<ericwood>
NemesisD: you're correct
<jrobeson>
hmm.. shoudln't you be able to write a script for that?
rwk1_ has joined #ruby-lang
<jrobeson>
something like zeus or whatever people use
<NemesisD>
the one jruby project we have runs tests under MRI and then under jruby when you're about to commit
<jrobeson>
seems like one should be able to do such a thing with the jvm in theory..
<NemesisD>
theres some guard thing that runs an instance of the JVM or something and kind of simulates zeus, but its pretty broken
<jrobeson>
so, how about rubinus tho?
<NemesisD>
that's still under pretty heavy development as far as I know. do you know if it solves the C API/memory freeing issue?
<jrobeson>
no.. i have no idea
<jrobeson>
i just wondered if you tried and failed with it
dagobah has joined #ruby-lang
<NemesisD>
our main app project has 184K SLOC of ruby in it
jonahR has quit [Quit: jonahR]
<gnufied>
wow
rwk1 has quit [Ping timeout: 240 seconds]
<NemesisD>
we're having a hard enough time getting it on rails 3
<NemesisD>
that includes tests and vendored plugins mind you
<gnufied>
no wonder and rails 4 is around the corner.
<ericwood>
Rails 4 is nowhere near as crazy of an upgrade
<NemesisD>
about 76k of just app code
<NemesisD>
ive got a few other apps running rails 4. it has gone pretty well, though we have to point quite a few gems at github repos for now
Kabaka has quit [Ping timeout: 240 seconds]
<NemesisD>
i'm a bit scared about ruby's future when it comes to these kind of long standing issues around concurrency and memory usage
<jrobeson>
well.. php is worse.. and their future is certainly not in doubt either..
<jrobeson>
so i wouldn't worry too much
<jrobeson>
i mean about the future
<jrobeson>
perhaps you'll be the person who comes up with some hack :)
<NemesisD>
i spend most of my free coding time on haskell
<NemesisD>
php might outlive us all
postmodern has joined #ruby-lang
<NemesisD>
but i see people jumping ship from ruby over concurrency issues
<NemesisD>
in a time where multi processors are proliferating, the party line of process-based concurrency is a bit perturbing
<jrobeson>
well. perhaps jruby will win the day
<NemesisD>
maybe. you could also argue it brings us into a new set of concurrency problems that our community hasn't really dealt with much yet
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
<NemesisD>
i think thats probably a better class of problem to have though
vlad_starkov has joined #ruby-lang
sr78ger has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
headius has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<NemesisD>
i gotta get to bed, thanks for clarifying my memory questions
Kabaka has joined #ruby-lang
NemesisD has quit [Quit: zzz]
rwk1 has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
headius has quit [Quit: headius]
rwk1_ has quit [Ping timeout: 264 seconds]
vlad_starkov has quit [Remote host closed the connection]
hogeo has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
wallerdev has quit [Client Quit]
bondar has quit [Ping timeout: 276 seconds]
brianpWins has joined #ruby-lang
<maloik>
Goooood morning
mistym has quit [Remote host closed the connection]
<erikh>
hiiiiiiiiiiiiiiiiiiiiiiiiii
dhruvasagar has quit [Read error: Connection reset by peer]
hogeo has joined #ruby-lang
dhruvasagar has joined #ruby-lang
headius has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
gja has joined #ruby-lang
hogeo has joined #ruby-lang
io_syl has quit []
dc5ala has joined #ruby-lang
antulik-afk is now known as antulik
vlad_starkov has joined #ruby-lang
headius has left #ruby-lang [#ruby-lang]
dhruvasagar has quit [Read error: Connection reset by peer]
rikai_ has joined #ruby-lang
rwk1 has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
julweber_ has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 264 seconds]
rikai has quit [Ping timeout: 240 seconds]
hhatch has joined #ruby-lang
skade has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
benlovell has joined #ruby-lang
apeiros has joined #ruby-lang
relix has joined #ruby-lang
bougyman has quit [Ping timeout: 264 seconds]
elia has joined #ruby-lang
gja has quit [Quit: This computer has gone to sleep]
bougyman has joined #ruby-lang
<ljarvis>
hi
hagebake has joined #ruby-lang
julweber has joined #ruby-lang
hagabaka has quit [Ping timeout: 256 seconds]
lightcap has quit [Quit: Computer has gone to sleep.]
RubyRookie has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gja has joined #ruby-lang
julweber has quit [Ping timeout: 264 seconds]
Criztian has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
runeb has joined #ruby-lang
Swooop has joined #ruby-lang
runeb has quit [Remote host closed the connection]
runeb has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
Swooop has left #ruby-lang [#ruby-lang]
dhruvasagar has joined #ruby-lang
Guest__ has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
julweber has joined #ruby-lang
dhruvasagar has joined #ruby-lang
bondar has joined #ruby-lang
elia has quit [Ping timeout: 245 seconds]
hogeo has quit [Remote host closed the connection]
hogeo has joined #ruby-lang
Johz has joined #ruby-lang
softrli has joined #ruby-lang
scholar01 has joined #ruby-lang
scholar01 has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 276 seconds]
elia has joined #ruby-lang
benlovell has joined #ruby-lang
<maloik>
Anyone know the difference between \Z and \z? I can't find a comprehensive answer
cads has quit [Read error: Operation timed out]
<jrobeson>
maloik, without actually looking.. it probably means the opposite
<jrobeson>
like \D or \d
<jrobeson>
\d == digits \D == not digits
<maloik>
From what I've found, I don't think it does
<maloik>
Found something that wasn't entirely clear to me, something to do with linebreaks
<yorickpeterse>
Log file doesn't exist? Lets just fucking ignore that and not raise anything
<yorickpeterse>
errrr log directory
<jrobeson>
Jem, also known as Jem and the Holograms, is an American animated television series that ran from 1985 to 1988 in U.S. first-run syndication. The show is about music company owner Jerrica Benton, her singer alter-ego Jem, her band the Holograms, and their adventure
MaddinXx_ has quit [Remote host closed the connection]
pothibo has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mbj has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby-lang
runeb has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 256 seconds]
mdedetrich has quit [Quit: Computer has gone to sleep.]
bondar has quit []
vjacob has quit [Quit: Leaving]
Domon has quit [Remote host closed the connection]
Domon has joined #ruby-lang
wudofyr has quit [Remote host closed the connection]
Domon has quit [Ping timeout: 245 seconds]
wudofyr has joined #ruby-lang
rwk1 has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
gja has quit [Quit: This computer has gone to sleep]
benlovell has quit [Quit: leaving]
benlovell has joined #ruby-lang
runeb has joined #ruby-lang
fedesilva has quit [Read error: Connection reset by peer]
fedesilva has joined #ruby-lang
Gu_______ has joined #ruby-lang
charlescooke has joined #ruby-lang
ruby-lang711 has joined #ruby-lang
ruby-lang711 has quit [Client Quit]
mbj has joined #ruby-lang
joshuairl has joined #ruby-lang
joshuairl has quit [Remote host closed the connection]
Caliban has quit [Ping timeout: 240 seconds]
nisstyre has quit [Read error: Connection reset by peer]
gja has joined #ruby-lang
gja has quit [Client Quit]
Caliban has joined #ruby-lang
vlad_sta_ has quit [Ping timeout: 249 seconds]
yalue has joined #ruby-lang
Nss has joined #ruby-lang
alekst has joined #ruby-lang
charliesome has joined #ruby-lang
toretore has quit [Read error: Connection reset by peer]
<yorickpeterse>
gnufied: does the Bundler Ruby API provide a way to get only the production dependencies? That is, everything that's not in a group basically
antulik is now known as antulik-afk
<gnufied>
No, there is no API for that
Pupeno has quit [Ping timeout: 264 seconds]
verto has joined #ruby-lang
jbsan has quit [Ping timeout: 241 seconds]
vlad_starkov has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
Hmpf, is ther a way to list Gems for a given group then?
<yorickpeterse>
If so I can basically just reject everything not in the default group
verto has quit [Read error: Connection reset by peer]
joonty has quit [Ping timeout: 246 seconds]
<gnufied>
look into Bundler::Definition class
<yorickpeterse>
ta
VTLob has joined #ruby-lang
<yorickpeterse>
Ah, specs_for
<yorickpeterse>
Bundler.definition.specs_for([:default]).map(&:name) was what I was looking for
<gnufied>
cool!
jsullivandigs has joined #ruby-lang
JasonA has joined #ruby-lang
jp- has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 256 seconds]
melter has quit [Remote host closed the connection]
enebo has joined #ruby-lang
fbernier has joined #ruby-lang
joonty has joined #ruby-lang
umgrossco has joined #ruby-lang
julweber has quit [Remote host closed the connection]
banisterfiend has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby-lang
poga_ has quit [Remote host closed the connection]
sascha_d has joined #ruby-lang
sush24 has joined #ruby-lang
poga has joined #ruby-lang
gja has quit [Quit: This computer has gone to sleep]
lsegal has joined #ruby-lang
<sluukkonen>
yep. the default gc settings are woefully inadequate for anything nontrivial.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lightcap has joined #ruby-lang
lfox has quit [Quit: ZZZzzz…]
<imperator>
although it seems like people aren't properly tearing down their instance variables which doesn't help
julweber has quit [Remote host closed the connection]
lfox has joined #ruby-lang
mmorga has quit [Remote host closed the connection]
<sluukkonen>
like the default malloc limit is 8MB. I'd bet that most rails apps allocate more than 8MB per request.
elia has quit [Ping timeout: 264 seconds]
sascha_d has quit [Ping timeout: 246 seconds]
kurko_ has quit [Ping timeout: 245 seconds]
richardburton has left #ruby-lang [#ruby-lang]
mmorga has joined #ruby-lang
rwk1 has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
charliesome has joined #ruby-lang
scholar01 has quit [Quit: Leaving.]
gja has joined #ruby-lang
gja has quit [Changing host]
gja has joined #ruby-lang
nbrock has joined #ruby-lang
nbrock has left #ruby-lang [#ruby-lang]
tbuehlmann has joined #ruby-lang
lsegal has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
tylersmith has joined #ruby-lang
mogglebam has joined #ruby-lang
hackeron_ has joined #ruby-lang
Kabaka has joined #ruby-lang
antulik-afk is now known as antulik
sirupsen has quit [Quit: sirupsen]
hackeron has quit [Ping timeout: 264 seconds]
mbj has joined #ruby-lang
hackeron_ has quit [Remote host closed the connection]
pskosinski has quit [Quit: Til rivido Idisti!]
runeb has joined #ruby-lang
rwilcox has joined #ruby-lang
rwilcox has left #ruby-lang [#ruby-lang]
tRAS has quit [Quit: Mother, did it need to be so high?]
x0f_ has joined #ruby-lang
benanne has joined #ruby-lang
runeb has quit [Ping timeout: 248 seconds]
machuga is now known as machuga|away
gja has quit [Quit: This computer has gone to sleep]
mogglebam has left #ruby-lang [#ruby-lang]
x0F has quit [Ping timeout: 276 seconds]
<tubbo>
hey do you guys think this is over-engineering?
<tubbo>
i have a module that i want to include in a class, but first, i want to verify that the class i'm including it into has a number of methods defined
mogglefrange has joined #ruby-lang
<mogglefrange>
Hi, I am looking for a tile-based open source game engine in ruby. Like, something for a graphical roguelike.
<tubbo>
so i was thinking i'd loop through them and raise an exception if the base class doesn't respond_to? :whatever_method
<mogglefrange>
So far I've only found some existing projects, and a library called gosu that is more low-level than I'd like.
<imperator>
tubbo, sounds like you want an interface
Nss has quit [Ping timeout: 245 seconds]
<tubbo>
imperator: yeah, conceptually that's what i'm going for.
<imperator>
it can be done, but that sort of rigidity is contrary to the ruby way
<tubbo>
yeah, i understand
<tubbo>
i was thinking of overriding self.included to do it (if i'm even going to)
<imperator>
i think there are some "traits" implementations floating around out there, too
banisterfiend has joined #ruby-lang
<tubbo>
that's cool
<tubbo>
yeah my idea was similar...it'd make an `attr_required` macro for your class, and basically that would act as a "validator" for whether those methods are defined on the base object
<whitequark>
that's nearly useless
<whitequark>
even if the methods do exist, there's no guarantee they accept the arguments you want, or even the number of arguments you want
diegoviola has joined #ruby-lang
<yorickpeterse>
herro
<erikh>
manveru has a trait impl iirc
tenderlove has joined #ruby-lang
Johz has quit [Ping timeout: 264 seconds]
<tubbo>
whitequark: heh, i guess so :) it's pretty much just avoiding a programmer error that's very easily solvable by RTFMing ;)
loincloth has quit [Remote host closed the connection]
cads has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
diegoviola has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
jonahR has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
kirin` has joined #ruby-lang
jvrmaia has quit [Quit: Leaving]
fcahoon has quit [Quit: Leaving]
sush24 has quit [Quit: This computer has gone to sleep]
brianpWins has quit [Quit: brianpWins]
sirupsen has quit [Quit: sirupsen]
richardburton has joined #ruby-lang
Uranio has joined #ruby-lang
__dropp` has quit [Ping timeout: 260 seconds]
<Uranio>
hi, how could I compare to dates for get diference in minuts
<Uranio>
for example
lightcap has quit [Quit: Computer has gone to sleep.]
joshuawscott has quit [Quit: Leaving.]
<Uranio>
2013-09-06 16:14:12 -0400 and 2013-09-06 16:08:12 -0400 and return minuts diference
<Uranio>
I tried with EPOCH but is very ugly :S
snk has quit [Quit: I accidentally the whole program.]
machuga is now known as machuga|away
havenwood has quit [Remote host closed the connection]
mistym_lunch is now known as mistym
rockpapergoat has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
<apeiros>
Uranio: Time#-(Time) returns seconds
gregmoreno has quit [Remote host closed the connection]
<Uranio>
apeiros: :D cool and simple
<Uranio>
thang: apeiros
richardburton has quit [Quit: Leaving.]
tenderlove has joined #ruby-lang
yalue has quit [Quit: Leaving]
tharindu_ has quit [Ping timeout: 264 seconds]
Johz has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
MaddinXx has quit [Remote host closed the connection]
soba has joined #ruby-lang
Uranio has quit [Quit: while you reading this, a kitty dies]
gregmoreno has joined #ruby-lang
MaddinXx has joined #ruby-lang
auroraLTP has joined #ruby-lang
soba has quit [Ping timeout: 245 seconds]
iliketur_ has joined #ruby-lang
jonahR has joined #ruby-lang
havenwood has joined #ruby-lang
auroraLTP has quit [Quit: ThrashIRC v2.9 sic populo comunicated]
tonni has quit [Remote host closed the connection]
tonni has joined #ruby-lang
cads has quit [Ping timeout: 245 seconds]
JasonA has quit [Ping timeout: 256 seconds]
joshuawscott has joined #ruby-lang
sirupsen has joined #ruby-lang
sirupsen has quit [Client Quit]
antulik-afk is now known as antulik
umgrossco has quit [Quit: Nettalk6 - www.ntalk.de]
cads has joined #ruby-lang
enebo has quit [Ping timeout: 246 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxie has quit [Ping timeout: 264 seconds]
jxie has joined #ruby-lang
jonahR has quit [Quit: jonahR]
mmorga has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Remote host closed the connection]
mmorga has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
pskrz has quit [Quit: pskrz]
ItSANg___ has joined #ruby-lang
antulik is now known as antulik-afk
tdm00 has quit [Quit: Make like a banana and split!]
ItSA_____ has joined #ruby-lang
ItS______ has joined #ruby-lang
ItSANgo has quit [Ping timeout: 245 seconds]
ItSANgo_ has joined #ruby-lang
<yorickpeterse>
MessagePack.pack(10) # => "\n"
<yorickpeterse>
lel
<yorickpeterse>
heh, \r is 13
ItSANgo has joined #ruby-lang
<apeiros>
and MessagePack.pack("\n")?
<yorickpeterse>
heh, msgpack doesn't even work on custom objects
ItSANg___ has quit [Ping timeout: 268 seconds]
<yorickpeterse>
apeiros: "\xA1\n"
havenwood has quit [Remote host closed the connection]
ItSA_____ has quit [Ping timeout: 264 seconds]
ItS______ has quit [Ping timeout: 260 seconds]
<apeiros>
thanks
<apeiros>
message pack was something I wanted to take a look at for a long time
<yorickpeterse>
I was wondering if it was faster than Marshal but if I can't use it for custom objects I'm not even going to bother
<yorickpeterse>
(unless you define a to_msgpack method yourself)
ItSANgo_ has quit [Ping timeout: 268 seconds]
yfeldblum has quit [Ping timeout: 248 seconds]
Nisstyre-laptop has joined #ruby-lang
<yorickpeterse>
hm neat, I can get processing time of file X in ruby-lint down from 1.53 seconds to about 0.37 seconds
<yorickpeterse>
by caching data
<yorickpeterse>
that's a pretty neat boost
brianpWins has joined #ruby-lang
MaddinXx has quit [Ping timeout: 245 seconds]
cored has quit [Ping timeout: 256 seconds]
iliketur_ has quit [Quit: zzzzz…..]
bgant has quit [Quit: Leaving.]
<yorickpeterse>
Does Ruby provide anything else unique similar to #object_id but something that persists between Marshal encodes?
<yorickpeterse>
#object_id changes in those cases
Johz has quit [Quit: Leaving]
<whitequark>
yorickpeterse: no
<yorickpeterse>
hmpf
<whitequark>
it's not sensible in general case. just add an explicit integer field.
<yorickpeterse>
this is actually parser related too, right now I basically take the #inspect value and location info and SHA1 that
joshuawscott1 has joined #ruby-lang
joshuawscott has quit [Read error: Connection reset by peer]
<yorickpeterse>
but that probably contributes to a significant execution time (as in, it could be even faster)
<whitequark>
ehh
<whitequark>
take its hash
<yorickpeterse>
you mean #hash ?
<whitequark>
yes. and then perform a deep comparison
<yorickpeterse>
does that stay the same between Marshal's ?
<whitequark>
hash? yes
<yorickpeterse>
Basically I'm caching an entire set of ASTs and the corresponding comment associations
<yorickpeterse>
hmmm
yfeldblum has joined #ruby-lang
<yorickpeterse>
hm, #hash changes between Ruby processes to
<yorickpeterse>
* too
<yorickpeterse>
darn it
<whitequark>
that should not happen
<apeiros>
#hash is seeded nowadays iirc
<whitequark>
oh
<whitequark>
apeiros is right
<apeiros>
you might get away with forcing the seed. not sure though.
<yorickpeterse>
Hmpf, seems a SHA1(#inspect) is the only reliable fingerprint of an object then
<apeiros>
try setting Kernel.srand explicitly
<whitequark>
it's dumb that a purely webapp thing is enabled by default
musl has joined #ruby-lang
<whitequark>
let rails execute Hash.seeded! or something
<apeiros>
hm, nope, seems the seeding is independent of srand()
<whitequark>
don't see any API to do that either
<apeiros>
odd… they should provide ways to fix it
<yorickpeterse>
I propose a new method: Object#webscale_object_Id
<apeiros>
otherwise testing is really hard…
<yorickpeterse>
it's implemented in Node.js
<apeiros>
yorickpeterse: Object#uuid
<yorickpeterse>
ssssh
<apeiros>
because we really really want 16 bytes of overhead on every object :-p
<apeiros>
(in addition to rubys 20 bytes)
<erikh>
I think that's called "windows"
<yorickpeterse>
methods like that could be lazy evaluated I guess
<yorickpeterse>
erikh: Object#windows # => random Ruby crash
<yorickpeterse>
errr Process#windows
<erikh>
what
kurko_ has quit [Read error: Connection reset by peer]
ItSANgo_ has joined #ruby-lang
<erikh>
have you been smoking the whacky tobaccy again
MaddinXx has joined #ruby-lang
<yorickpeterse>
I don't smoke
<yorickpeterse>
"The hash value for an object may not be identical across invocations orimplementations of ruby. If you need a stable identifier across rubyinvocations and implementations you will need to generate one with a custommethod."
<yorickpeterse>
(location stuff as in file name, column and line number)
pothibo has quit [Quit: pothibo]
<erikh>
oh, unique
<erikh>
feh
<erikh>
sha's aren't unique iether
<yorickpeterse>
No, but the input is in this case
<yorickpeterse>
the SHA1 is just there so I can use it for file names and such
<yorickpeterse>
and don't have to store gigantic strings
<whitequark>
erikh: shas are unique for all practical purposes
kurko_ has joined #ruby-lang
<erikh>
they are unique for a given input
<yorickpeterse>
what he probably means is SHA1(a) == SHA1(a)
<erikh>
but yorick already answered that
rsl has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 264 seconds]
<whitequark>
ah
ItSANgo_ has quit [Ping timeout: 245 seconds]
<yorickpeterse>
heh, using Zlib compression reduces the Marshal size by about 5 times
<yorickpeterse>
from 685K to 173K
<yorickpeterse>
>> errr that's not 5 time sdumbass
<eval-in>
yorickpeterse => /tmp/execpad-2843ba882c32/source-2843ba882c32:2: unterminated string meets end of file ... (https://eval.in/47243)
<yorickpeterse>
* times dumbass
<yorickpeterse>
lel wtf
<yorickpeterse>
I'm getting sleep drunk
<yorickpeterse>
I should probably not commit this code now
<yorickpeterse>
that's 4 times apparently
MaddinXx has quit [Remote host closed the connection]
<yorickpeterse>
3.95953757225433526011 according to `bc`
breakingthings has quit []
havenwood has joined #ruby-lang
iliketur_ has joined #ruby-lang
pskosinski has joined #ruby-lang
joshuawscott1 has quit [Quit: Leaving.]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
jsullivandigs has quit [Read error: Connection reset by peer]
jsullivandigs has joined #ruby-lang
ItSANgo has joined #ruby-lang
imperator has quit [Quit: Leaving]
joshuawscott has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
tomplast has quit [Read error: Connection reset by peer]
tomplast has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
mbj has quit [Ping timeout: 245 seconds]
mbj has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
bungoman has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
cored has quit [Ping timeout: 260 seconds]
lightcap has joined #ruby-lang
mmorga has quit [Remote host closed the connection]
Kabaka has quit [Ping timeout: 240 seconds]
jonahR has joined #ruby-lang
mmorga has joined #ruby-lang
Kabaka has joined #ruby-lang
mbj has quit [Ping timeout: 264 seconds]
tomplast has quit [Ping timeout: 261 seconds]
lfox has quit [Quit: ZZZzzz…]
jonahR has quit [Quit: jonahR]
womble has joined #ruby-lang
<womble>
Is there any opinion on whether a class which includes Enumerable is allowed to provide an #each method which only does the right thing the first time its called?
mdedetrich has joined #ruby-lang
<drbrain>
womble: seems restrictive
lfox has joined #ruby-lang
mmorga has quit [Remote host closed the connection]
joshuawscott has joined #ruby-lang
tomplast has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
<whitequark>
womble: "Enumerator" works like that, isn't it?
<workmad3>
womble: you mean like a File object already does? :)
Nisstyre-laptop is now known as Nisstyre
iliketur_ has quit [Quit: zzzzz…..]
kurko_ has quit [Quit: Computer has gone to sleep.]
ledestin has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
tenderlove has quit [Remote host closed the connection]
kvs has quit [Ping timeout: 240 seconds]
tylersmith has quit [Remote host closed the connection]
womble has quit [Excess Flood]
kvs has joined #ruby-lang
womble has joined #ruby-lang
iliketur_ has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
hagebake is now known as hagabaka
rwilcox has joined #ruby-lang
rwilcox has quit [Client Quit]
workmad3 is now known as wm3|zzz
tomzx_mac has joined #ruby-lang
jxpx777 has joined #ruby-lang
jiuweigui has quit [Quit: Gone...]
fedesilv_ has joined #ruby-lang
jonahR has joined #ruby-lang
fedesilva has quit [Ping timeout: 256 seconds]
lightcap has quit [Quit: Computer has gone to sleep.]
shtirlic_ has joined #ruby-lang
shtirlic_ has quit [Remote host closed the connection]