<mislav>
compiling ruby: is there a way to specify to `configure` that I want it to fail if libopenssl is not found on the system? basically I want ruby build process to fail fast if dependencies for openssl & zlib extensions are missing
<mislav>
otherwise ruby compilation succeeds without warnings but openssl and zlib are not available at require time
rob___ has left #ruby-lang [#ruby-lang]
<whitequark>
I don't think so
Dernise has joined #ruby-lang
falten has joined #ruby-lang
<Dernise>
I always have the feeling that I produce crap code.
<Dernise>
What's the best way to produce great code ? What do you do when you start programming ? Do you use UML ?
<Dernise>
I need some pro tips..
MaddinXx has joined #ruby-lang
<soahccc>
Dernise: UML is not that helpful especially with ruby. You can read some code guides, use some code analyzer or look at the code of other projects (or even ruby standard library)
<Dernise>
What about rspec?
<soahccc>
You mean testing generally?
swav__ has joined #ruby-lang
hashkey_ has joined #ruby-lang
thepumpkin has joined #ruby-lang
swav__ has quit [Remote host closed the connection]
hashkey has quit [Ping timeout: 248 seconds]
swav_ has quit [Ping timeout: 276 seconds]
elia has joined #ruby-lang
<Dernise>
soahccc: yes
<Dernise>
Should I avoid doing things like : module ServiceManager end; include ServiceManager
hashkey_ is now known as hashkey
workmad3 has quit [Ping timeout: 240 seconds]
<yorickpeterse>
UML is retarded
<yorickpeterse>
What you should do is wrote more code
<yorickpeterse>
There's no silver bulllet to become a l33t programmer
vlad_starkov has joined #ruby-lang
<yorickpeterse>
Just like anything else it requires time, effort and dedication
bradsmith has joined #ruby-lang
<apeiros>
so the silver bullet is time, effort and dedication?
<whitequark>
more like a wet, rusty iron one
<yorickpeterse>
^
<yorickpeterse>
Hm, to Judy array or to hash map
<yorickpeterse>
either way I cbf implementing either one manually
<Dernise>
Well yes. My code is working but looks "crap" to my eyes
<yorickpeterse>
lol Arch linux: search for "hash map", first result is Perl
<whitequark>
obviously
bradsmith has quit [Ping timeout: 264 seconds]
konpyu has quit [Remote host closed the connection]
elia has quit [Ping timeout: 260 seconds]
wallerdev has joined #ruby-lang
brushbox has joined #ruby-lang
archer_ has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
archer_ is now known as Guest61340
apeiros has joined #ruby-lang
brushbox has quit [Ping timeout: 264 seconds]
realDAB has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
postmodern has quit [Quit: Leaving]
yxhuvud has joined #ruby-lang
yxhuvud2 has quit [Ping timeout: 246 seconds]
<yorickpeterse>
what the shit clang, <stdio.h> not found?
<yorickpeterse>
and interesting enough another project using that compiles just fine...
realDAB has quit [Read error: Connection reset by peer]
heftig has quit [Quit: Quitting]
realDAB has joined #ruby-lang
heftig has joined #ruby-lang
<whitequark>
looks like a bad installation
thebastl has joined #ruby-lang
<yorickpeterse>
looks like "fuck you C"
<yorickpeterse>
probably goof'd some config but it shouldn't be a big deal anyway
<yorickpeterse>
hm wait, I do have a local include/ dir
<yorickpeterse>
lets see if that's it
<yorickpeterse>
nope
workmad3 has joined #ruby-lang
<whitequark>
how did you install clang?
<yorickpeterse>
via my package manager
<yorickpeterse>
and it's not clang specific, gcc also does it
<whitequark>
oh
<yorickpeterse>
oh durrrrrrrrrrrr
* yorickpeterse
bangs head
* yorickpeterse
used #include "<malloc.h>"
<yorickpeterse>
hahaha
<yorickpeterse>
I need more tea
<whitequark>
>The <malloc.h> header is deprecated (and quite Linux specific)
richardburton has quit [Quit: Leaving.]
<whitequark>
use, iirc, stdlib.h
<yorickpeterse>
right
Banistergalaxy has quit [Ping timeout: 264 seconds]
<whitequark>
yes
<matti>
Hm.
<matti>
;]
richardburton has joined #ruby-lang
emiltin has joined #ruby-lang
<Dernise>
is it possible to redirect stdout to a variable and do a thing like variable.readlines.each do |l| puts l; end; I tried $stdout.reopen variable but I have this error : `reopen': no implicit conversion of nil into String (TypeError)
<matti>
Dernise: To a variable?
<matti>
Dernise: What do you want to redirect?
<Dernise>
Well I started a new process with fork
<matti>
Ah.
<Dernise>
Well I double forked to run a daemon
<Dernise>
And i'd like to redirect the stderr and stdout
<vjacob>
is #ruby-lang more for Ruby-specific questions, or where in lies the difference to #RubyOnRails?
<matti>
vlad_starkov: ruby-2.0.0
<matti>
vlad_starkov: RoR -> #rubyonrails
<matti>
Ops.
<matti>
vjacob: ;d
<vlad_starkov>
both commands returns usage information: "rvm get {latest|x.y.z|head|master|branch|help}..."
<Dernise>
so try rvm get latest
<Dernise>
and then rvm install 2.0.0
VTLob has joined #ruby-lang
<vlad_starkov>
`rvm get latest` returns "You already have the latest version! RVM reloaded!"
<Dernise>
strange
<vlad_starkov>
I'm trying it on OSX
<vlad_starkov>
Maybe I should sudo it?
<Dernise>
I'm also on OSX.
<matti>
vlad_starkov: On OS X I recommend rbenv.
<matti>
vlad_starkov: Get homebew, then bew rbenv and then brew ruby-install.
<matti>
vlad_starkov: Then rbenv install ...
<matti>
vlad_starkov: Pain-free.
<whitequark>
apeiros: oh by the way, talking about memory constraints and such
<whitequark>
linking webkit takes about 8 hours
<whitequark>
on a 12-core i7
<whitequark>
sure you want it to be a shared library.
<workmad3>
vlad_starkov: don't sudo it
<workmad3>
vlad_starkov: most likely you've just got an old rvm, so do 'rvm get head'
<workmad3>
or 'rvm get stable'
<vlad_starkov>
I have version 1.10
<apeiros>
whitequark: ouch
<apeiros>
whitequark: I thought modern compilers only relink changed stuff?
<apeiros>
not that I understood any of the details…
<workmad3>
vlad_starkov: well, the latest on github is 1.21.20
<workmad3>
vlad_starkov: so yeah, you have a pretty old version ;)
<vlad_starkov>
OK
<vlad_starkov>
Thanks guys!
<whitequark>
apeiros: MSVC indeed does
<whitequark>
everyone else: not so much
<whitequark>
talking about perspective: GCC will never have incremental, clang, maybe, if someone's interested enough.
<apeiros>
I thought xcode too
<whitequark>
I don't think so, unless they use a radically different clang than the FOSS version
<whitequark>
which is unlikely
<whitequark>
it could also be something related to Mach-O... not sure really
realDAB has quit [Quit: realDAB]
<heftig>
whitequark: just linking webkit takes 8 hours, or the entire build?
<whitequark>
heftig: iirc just linking
<heftig>
that's mad. a PGO (double) build of firefox takes about 100 minutes on a 4-core i7 here
<whitequark>
granted it's a number for linking with LTO
<apeiros>
I think both numbers are insane
<whitequark>
and yes, exactly
<apeiros>
and I really wonder why it takes that much time and why it's not being reducde
<apeiros>
*reduced
<whitequark>
I know people who have compiled LLVM on Raspberry Pi for 30 hours
<whitequark>
and that's just ARM
<whitequark>
(incidentally, that's why we have cross-compiling, but not crossing has its advantages)
<whitequark>
apeiros: algorithms with nlogn or n^2 time, with really big n due to lots of code.
<whitequark>
so it's not like you can do anything
<whitequark>
write less code ;)
<apeiros>
why does linking have n^2 algorithms in it? o0
<Dernise>
is it possible to redirect stdout to an IO pipe ?
<heftig>
IPO and stuff
<whitequark>
^ that
<apeiros>
initial public offering? :)
<whitequark>
interprocedural optimization
<heftig>
interprocedural optimization
<apeiros>
shouldn't that be cacheable?
<whitequark>
that's what incremental builds do
<whitequark>
but it's hard
<apeiros>
i.e., cache, verify how much cache still applies, reducing total checking time?
<whitequark>
besides, you have C++ and C++ can easily have very wide ripple effects due to template monomorphization
<whitequark>
well, that doesn't apply if you are not developing webkit
<apeiros>
`dead code elimination` - sounds like a step which should be used to refactor the code and not be done on every compilation…
<whitequark>
it is used to kill dead code exposed as a result of optimization
<whitequark>
not something you know is dead upfront.
<apeiros>
so?
<whitequark>
for example you inline a function and notice that a branch in it is never taken, so you kill that entire part
<heftig>
or dead code result of a compile-time constant, such as feature A support
<apeiros>
for a release, only one person should have to run that
<whitequark>
huh?
<apeiros>
*for any given release
<apeiros>
or are those optimizations platform dependent?
<whitequark>
DCE is not
<whitequark>
the conditions in which the code becomes dead, however, may well be
<whitequark>
are you suggesting to somehow record which code becomes dead and then not emit it? that's not possible in general case
<heftig>
I think he's thinking of the DCE step being at the source code level
<heftig>
which it's not
realDAB has joined #ruby-lang
<whitequark>
yeah, source code only exists before the front-end
<whitequark>
that being said, 60-80% of compile (not link) time for C++ code is spent in the parser.
* whitequark
shrugs
<heftig>
how platform-dependent are llvm bitcode files?
<whitequark>
heftig: entirely.
<whitequark>
i.e. down to a target triple.
<heftig>
hm, I suppose they're only interesting in the compiler or for cpu-specific (but not platform-specific) optimization
<whitequark>
yes
<whitequark>
that's what Google's PNaCl does.
<heftig>
i.e. using that FMA
* whitequark
nods
<whitequark>
the frontend must know the target ABI, alignment rules, and there are some operations which require emitting target-specific IR, of various degrees of obscurity.
<whitequark>
he's a v8 dev and he explains why you don't need a separate asm.js compiler, or even (mostly) specification.
<apeiros>
whitequark: yes, I thought of either applying the result of DCE to the source or if that's not possible cache the results of DCE and store it as part of the source.
<whitequark>
of the _source_? wtf?
<apeiros>
well, repository
<whitequark>
DCE is specific down to a particular compiler revision
<whitequark>
*DCE results
<whitequark>
as all other optimizations are
<heftig>
and as said, happens after inlining
<whitequark>
besides, that makes no sense either way
Sammidysam has joined #ruby-lang
<whitequark>
asking the cache "is this code dead" is inherently slower than just checking if it's dead
<apeiros>
:-/
<whitequark>
in llvm, the latter is a single comparison
<whitequark>
you add disk and some kind of path-specific map table latency
<Sammidysam>
Can `variable = this or that` not be used (is `variable = this || that` required?)?
<whitequark>
yes
<Sammidysam>
Okay, thanks.
retro|cz has joined #ruby-lang
Sammidysam has quit [Client Quit]
<apeiros>
precedence strikes again
<apeiros>
`x = a or b` is `(x = a) or b`
<apeiros>
oh, he left already
thebastl has quit [Remote host closed the connection]
<whitequark>
tmLanguage files are confusing :/
vlad_starkov has quit [Remote host closed the connection]
<Dernise>
matti: If I want to run a process and control it with it's STDOUT and STDIN should I use PTY instead of running it as a daemon ?
Sammidysam has joined #ruby-lang
<Sammidysam>
What must be done to puts the return value of a method? Is it just `puts method_name` or does something special have to be done?
<apeiros>
`puts foo` works
richardburton has quit [Quit: Leaving.]
<apeiros>
but it will call to_s on the return value if it's not a string
<apeiros>
(also array gets special treatment)
<apeiros>
also look at Kernel#p
richardburton has joined #ruby-lang
<Sammidysam>
Okay, thanks.
<apeiros>
Sammidysam: also, regarding your previous question: `x = a or b` is `(x = a) or b`
<Sammidysam>
Ah, that's what I assumed once I saw that || worked.
<apeiros>
(you didn't get that one because you're a quitter :-p)
<Sammidysam>
Thanks for letting me know.
<heftig>
whitequark: does PNaCl define its own ABI or does it use the host ABI?
<heftig>
i.e. there's a pnacl triple that has nothing to do with x86_64 or arm
brushbox has joined #ruby-lang
<heftig>
because I think it does, otherwise it'll hardly be portable
rippa has joined #ruby-lang
<whitequark>
heftig: host ABI, I think
<whitequark>
otherwise it would not be compatible with existing code, which it is
Sammidysam has quit [Quit: Leaving]
<heftig>
whitequark: no, seems it defines its own abi
<erikh>
it's effectively useless without them though
<erikh>
many gems and a lot of the stdlib expects them to exist
<zzak>
erikh: depends on your definition of useful
* erikh
whistles at net/http
iliketurtles has joined #ruby-lang
iliketurtles has quit [Max SendQ exceeded]
<zzak>
some people might consider openssl a security threat
<zzak>
or a compiler for that matter
<zzak>
lol
iliketurtles has joined #ruby-lang
<erikh>
as an ops person and someone who is allergic to tinfoil I am going to politely bow out now :)
bradsmith has joined #ruby-lang
richardburton has joined #ruby-lang
realDAB has joined #ruby-lang
bradsmith has quit [Ping timeout: 240 seconds]
richardburton has quit [Ping timeout: 264 seconds]
sjltaylor has joined #ruby-lang
iliketurtles has quit [Ping timeout: 264 seconds]
robbyoconnor has quit [Ping timeout: 264 seconds]
yfeldblum_ has quit [Read error: Connection reset by peer]
yfeldblum_ has joined #ruby-lang
iliketurtles has joined #ruby-lang
<yorickpeterse>
erikh: may I advice concrete? It also works quite well to block out any form of radiation
<yorickpeterse>
Though a concrete hat is probably not very user friendly
amerine has quit [Ping timeout: 248 seconds]
yfeldblum_ has quit [Read error: Connection reset by peer]
arooni-mobile has quit [Ping timeout: 246 seconds]
realDAB has quit [Quit: realDAB]
arooni-mobile__ has quit [Ping timeout: 260 seconds]
robbyoconnor has joined #ruby-lang
jonahR has joined #ruby-lang
netShadow has quit [Quit: netShadow]
kurko_ has joined #ruby-lang
pkrnj has quit [Quit: Computer has gone to sleep.]
yfeldblum_ has joined #ruby-lang
yfeldblum_ has quit [Read error: Connection reset by peer]
yfeldblum_ has joined #ruby-lang
yfeldblum_ has quit [Read error: Connection reset by peer]
arooni-mobile__ has joined #ruby-lang
brushbox has joined #ruby-lang
mbj has quit [Quit: leaving]
brushbox has quit [Ping timeout: 264 seconds]
brushbox1 has joined #ruby-lang
brushbox1 has quit [Client Quit]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brushbox has joined #ruby-lang
solars has quit [Read error: Operation timed out]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
bradsmith has joined #ruby-lang
richardburton has joined #ruby-lang
relix has joined #ruby-lang
pkrnj has joined #ruby-lang
elia has joined #ruby-lang
bradsmith has quit [Ping timeout: 260 seconds]
relix has quit [Ping timeout: 246 seconds]
richardburton has quit [Ping timeout: 264 seconds]
setmeaway has joined #ruby-lang
arooni-mobile has joined #ruby-lang
elia has quit [Ping timeout: 276 seconds]
enebo has quit [Quit: enebo]
iliketurtles has quit [Quit: zzzzz…..]
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
tanema has joined #ruby-lang
hogeo_ has joined #ruby-lang
tanema has quit [Remote host closed the connection]
tanema has joined #ruby-lang
hogeo has quit [Ping timeout: 240 seconds]
Forgetful_Lion has quit [Remote host closed the connection]
tanema_ has joined #ruby-lang
tanema has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 246 seconds]
Nisstyre-laptop has joined #ruby-lang
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
VTLob has quit [Quit: VTLob]
mistym has quit [Remote host closed the connection]
poga has quit [Remote host closed the connection]
Sammidysam has joined #ruby-lang
<Sammidysam>
To clone the class that a method being written in, would it be `self.clone`?
weems has quit [Remote host closed the connection]
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nisstyre-laptop is now known as Nisstyre
workmad3 has joined #ruby-lang
<Sammidysam>
To clarify better, I have a class that I am adding a method to append to a variable in and I have one where it modifies the current variable and one where it returns a duplicate. So how do I duplicate it?
arooni-mobile has quit [Ping timeout: 264 seconds]
arooni-mobile__ has quit [Ping timeout: 264 seconds]
<Sammidysam>
self.clone seems to have left the variable modified
robbyoconnor has quit [Remote host closed the connection]
sjltaylor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
bradsmith has joined #ruby-lang
ledestin has joined #ruby-lang
bradsmith has quit [Ping timeout: 260 seconds]
brushbox has quit [Quit: Leaving.]
rickhull has quit [Quit: Leaving.]
<lsegal>
Sammidysam #dup and #clone are shallow object copies, which means they don't copy the ivars
<Sammidysam>
lsegal: Then is it possible to copy the instance variables?
<Sammidysam>
lsegal: Without manually setting them?
<lsegal>
it's certainly possible. you can write a method that copies the instance variables.
<waxjar>
Marshal.load(Marshal.dump(obj)) is the trick people use i think
<lsegal>
very inefficient, but it works, yes
<lsegal>
activesupport has a #deep_dup method. you can find other libraries with similar implementations too, or you can roll your own. it's pretty easy to write
<Sammidysam>
I will look into it. Thanks.
tanema_ has quit [Remote host closed the connection]
realDAB has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
tobiasvl has quit [Ping timeout: 264 seconds]
tobiasvl has joined #ruby-lang
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
jonahR has quit [Quit: jonahR]
tanema has joined #ruby-lang
<Sammidysam>
`Marshal.load(Marshal.dump(self))` worked perfectly. Thanks!
<lianj>
lol
ssb123 has joined #ruby-lang
hogeo_ has quit [Remote host closed the connection]
JohannHann has joined #ruby-lang
pkrnj has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby-lang
postmodern has joined #ruby-lang
realDAB has quit [Quit: realDAB]
vlad_starkov has quit [Ping timeout: 240 seconds]
zorg24 has joined #ruby-lang
workmad3 has quit [Ping timeout: 248 seconds]
Sammidysam has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
JohannHann has quit [Quit: Leaving.]
bradsmith has joined #ruby-lang
poga has joined #ruby-lang
bradsmith has quit [Ping timeout: 256 seconds]
Nisstyre has quit [Quit: Leaving]
havenwood has quit [Remote host closed the connection]