<dingus_khan>
just watched that video julian posted, dafuq did I just watch, lol
<dingus_khan>
julian, I'm not sure if that was somehow a backhanded compliment, hah
<julianhurley>
All I know is, erikh is 'papa'
<dingus_khan>
but he'd surely come to my recitals !
<julianhurley>
hmm
<erikh>
haha
<erikh>
uh
<erikh>
come to daddy?
<julianhurley>
no
<julianhurley>
also
<dingus_khan>
lmao
megha has joined #ruby-lang
baba has quit [Ping timeout: 264 seconds]
<dingus_khan>
wait, erik, which of those links would best fit what I need right now, do you think? (please don't let it be the Why's Poignant thing, that shrieked at my mind like a cracked out banshee...)
<dingus_khan>
he's gonna say all of them...
<dingus_khan>
shit
<erikh>
pickaxe, or if chris pine's learn to program is still on there
<erikh>
have you done programming in any other languages before?
<dingus_khan>
I did some C++ years ago and I took a pretty pedestrian course in PHP
<erikh>
ok, the second link I just pasted there is probably what you want then
<erikh>
if you like it, it's available at pragprog.com with significant updates for around $20.
<erikh>
you should buy it.
<erikh>
it should work for almost every lesson though, but you might run into some problems (it covers ruby 1.6)
<dingus_khan>
dang, alright, I'll see about making that happen then. and pine was sort of short on detail for me, as far as explanations and discussion of features and all that... :/
<erikh>
right, pine is for people new to programming, not just ruby.
<erikh>
pickaxe is a little more technically-oriented.
<erikh>
s/ly//
<dingus_khan>
alright, roommate has a copy of pickaxe somewhere, just remembered that actually
<erikh>
oh perfect
<erikh>
although you should give them money anyways
<erikh>
:P
<erikh>
the author is the original author of rdoc, and is responsible for a lot of ruby code you likely will use
marr has joined #ruby-lang
<dingus_khan>
as soon as I'm not a broke-ass schmuck, I'll totally get right on the book buying and money giving, cause I totally agree with supporting the right people!
<dingus_khan>
I guess I was confused about passing a whole array into an instance variable--nowhere in anything I've read did I explicitly see it state that I could do that, and I guess instance "variable" threw me off...
<dingus_khan>
it totally is
<dingus_khan>
whew
<dingus_khan>
lol
<dingus_khan>
thank you guys!
<erikh>
you can do some surprising things with objects in ruby.
<erikh>
there are very few limitations.
<dingus_khan>
it must have said it somewhere though, instance variables can contain next to anything or something like that
<erikh>
not next to
<erikh>
can
<dingus_khan>
right, it seems to be creeping back into my mind
<dingus_khan>
gotcha
<dingus_khan>
that's pretty rad
<dingus_khan>
damn you memory of mine!
<dingus_khan>
yeah that's the crazy thing about ruby to me--everything is an object?! *everything*?! damn
<erikh>
yeah, banisterfiend who's in here on AUS time has a chart of the inter-dependencies of the internals
<erikh>
it's kind of scary, but worth looking at, at least once
<dingus_khan>
that sentence just blew my mind, and I'm not even sure why, lol
<dingus_khan>
for sure, that's an awesome thing to have around I bet
<dingus_khan>
as I'm fairly visually-oriented, I'd like to see it someday, so hopefully I'll catch him at some point
<erikh>
like, a class is an object but Object is a class too
<erikh>
some of that stuff.
<dingus_khan>
it's so crazy! XD
<erikh>
heh, it's just a little hairy around those areas.
<dingus_khan>
better than Java though, amirite?!
<erikh>
I think so
<erikh>
it's not a universal feeling though.
<dingus_khan>
did not like it
<dingus_khan>
good
vlad_starkov has joined #ruby-lang
<dingus_khan>
I mean bad, because java is also universal... :/
<dingus_khan>
alright, I have work to do and you have to bail, so I'll thank you again and become mostly absent from here on! thanks for the help and the reading material guidance, stern violin-obsessed internet father-figure!
marr has quit [Ping timeout: 252 seconds]
<dingus_khan>
oh thanks julian!
<dingus_khan>
*and thanks julian, that's the one
vlad_starkov has quit [Ping timeout: 255 seconds]
krohrbaugh has joined #ruby-lang
<erikh>
what a weirdo
krohrbaugh has quit [Ping timeout: 264 seconds]
ikrima has quit [Ping timeout: 245 seconds]
ikrima has joined #ruby-lang
migz has joined #ruby-lang
fosky has joined #ruby-lang
fosky has quit [Remote host closed the connection]
fosky has joined #ruby-lang
<apeiros>
OMG, I hate windows so much :(
<apeiros>
I didn't tell it to auto-update - yet it decides to auto-update and reboot mid-game. f*ck you microsoft. srsly.
henrikhodne has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<erikh>
apeiros: 3am?
dingus_khan has quit [Ping timeout: 264 seconds]
idkazuma has quit [Remote host closed the connection]
sepp2k1 has quit [Remote host closed the connection]
<apeiros>
yes, why?
<apeiros>
well, 03:30
<erikh>
that's when they push security updates
vlad_starkov has quit [Ping timeout: 260 seconds]
<erikh>
get used to it, it happens about once a month.
<apeiros>
it sucks
<erikh>
indeed, but I get their reasoning
<apeiros>
push updates - fine. but ask me about reboot
<erikh>
fwiw, if you weren't in a full screen game
<apeiros>
I was
<erikh>
there would be a popup that lets you delay it
<apeiros>
there wasn't
<erikh>
well probably because when you exited it, it was because the machine was rebooting, rihgt?
<erikh>
there was one sitting there for about 10 minutes -- trust me on this
<erikh>
you just couldn't see it because of the full screen.
<apeiros>
I don't care whether there was one
<apeiros>
I never saw one
<erikh>
sure, I get it.
<apeiros>
I had zero chance to veto
<apeiros>
in other words - after 30 years in the game, microsoft still sucks
<erikh>
haha
<apeiros>
I don't get how you can still do such basic stuff so wrong after so much time… I mean fuck what?
<erikh>
well, on the bright side, grandma's computer is a little more secure now
<erikh>
which means less spam for us
<apeiros>
on the downside - grandma (and I!) might just have lost hours of unsaved work
<erikh>
not disagreeing
<erikh>
it's just one of those, er, trade-offs
<apeiros>
it didn't need to be one
<erikh>
well, no, it does. I have to nag my wife to apply updates, and she... is married to me
<erikh>
(she knows better)
<apeiros>
I'm not opposed to force-push updates
<apeiros>
I'm opposed to the way it forces the reboot *now*
<erikh>
it doesn't. it asks about 10 minutes prior and gives you an option to delay it
<erikh>
and it'll sit there until you do something to it. like I said, you didn't see it because of the full screen.
<apeiros>
if it did, windows failed at asking me
<apeiros>
because I never saw the popup
<erikh>
right, sometimes games don't flip out for pop up notifications
<erikh>
starcraft perhaps?
<apeiros>
just mid-game, my game quits, and for ~2s I see a text "updating windows" (or somesuch) and "rebooting now" (or somesuch)
<erikh>
yep
<erikh>
you missed the pop-up
<erikh>
that's really what happened there.
<apeiros>
I'm sorry if I don't blame the game
<erikh>
no, some games quell popups from interrupting the game
<erikh>
like... starcraft
<apeiros>
if windows is able to force-quit it, it should be able to force-show the dialogue
<apeiros>
I wouldn't wonder though if they had an API for that, m$ would manage to blatantly abuse it anyway…
<apeiros>
*sob*
<erikh>
anyhow, that's what happened, fwiw.
<apeiros>
still hating microsoft with passion. not because they're microsoft. but because they simply suck at their game.
<erikh>
dunno, I liked windows 7
<apeiros>
I don't :-/
<erikh>
it's not my ideal workstation environment, but it's not really that bad
<erikh>
nice for wintendo
<apeiros>
well, I don't use it as a workstation
<erikh>
and VS.net is ... pretty f'n amazing
<erikh>
and C#, etc.
<erikh>
their XML parser I've been wanting to turn into a ruby library for some time now
<erikh>
it's really really brilliant.
<apeiros>
m$ has their best stuff in research
<apeiros>
they have some awesome stuff in research
<erikh>
yep
<apeiros>
yet they don't get their game together in "the real world"
<erikh>
yeah, I think that's more of a business side thing
<apeiros>
I'd assume because in research, there's little management
<apeiros>
(or at least "less management")
<erikh>
they also have 25 years of compromises to ensure remain compatible
<apeiros>
haha
<apeiros>
yeah. but they still randomly break compatibility
<apeiros>
better have clean cuts than the broken mess of "compatibility" they have…
<erikh>
it's usually not a deliberate choice, though.
<erikh>
some trade they have to make.
<erikh>
right.
<apeiros>
…
<erikh>
I agree with you, but that's how they roll
<erikh>
perl has a lot of the same issues.
<apeiros>
I remember full well the what, 3 APIs? I had to use in VB in order to use databases.
<erikh>
ah, that's been mostly curbed since .net
<apeiros>
because one was incomplete, the other deprecated and the last one broken…
<erikh>
linq is pretty much the only way to fly these days.
<apeiros>
lol, so a 5th one has emerged…
<erikh>
linq is badass.
<erikh>
really.
<apeiros>
meh. maybe.
<erikh>
I wish OSS had something that awesome.
<erikh>
(it doesn't.)
<apeiros>
looks a bit like arel on a quick WP glance…
<erikh>
C# has a full lisp-style syntax transformer in it. linq leverages it to provide a SQL style mini-language
<apeiros>
(though, I'm drunk and it's 03.30…)
<erikh>
arel came.. a touch later.
<erikh>
and it's still not the same beast.
<apeiros>
such abstractions tend to be leaky
<erikh>
you'd be surprised.
GeissT has joined #ruby-lang
<apeiros>
I might
<apeiros>
but since I don't trust M$ one nose-length, I'll never try it.
<erikh>
don't knock it until you try it, is all I'm saying.
<erikh>
hah
<apeiros>
their track-record doesn't incline me to invest any time into learning any of their tools
<erikh>
anyhow, you have a date with starcraft and I have civ 5 to play with the better half
<apeiros>
ooooh
<erikh>
I can understandt hat
<apeiros>
your better half plays games?
<erikh>
yes
* apeiros
is jealous
<erikh>
she's quite enamored with team fortress 2
<erikh>
eh
<erikh>
we've been together for almost 15 years now
<erikh>
it was going to happen eventually.
<apeiros>
well, mine has a good excuse for the moment
<apeiros>
unlike I, she doesn't have an "end of work, I can do now as I please", since she's still studying :-/
<erikh>
ah
<erikh>
$wife is a tutor, so she works odd hours, but finds time to play now and again
<apeiros>
well, if she didn't have all classes in a foreign language, mine could probably find some time too
<apeiros>
but ^ is a little bit of an issue :-(
rushed has quit [Quit: rushed]
<apeiros>
(my wife is mongolian. she only spoke mongolian when she came here, and now she has/had to learn german, english, french and spanish for studies… - and german on the level of mother-tongue)
<apeiros>
anyway, bed time. have fun with civ5 erikh! :)
dhruvasagar has joined #ruby-lang
idkazuma has joined #ruby-lang
retro|cz has joined #ruby-lang
migz has quit [Quit: Leaving.]
dingus_khan has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
intellitech has quit [Quit: intellitech]
<erikh>
thanks!
<erikh>
enjoy rest
poga has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 268 seconds]
LineByLine has joined #ruby-lang
dhruvasagar has joined #ruby-lang
lacrosse has quit [Read error: Connection reset by peer]
sush24 has quit [Quit: This computer has gone to sleep]
<erikh>
and serve da files
<erikh>
am serving das files
vlad_starkov has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
nixterrimus has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
marr has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
<MouseTheLuckyDog>
I have a program, which asks the user questions interactively, which I want to run as a subprocess of a ruby program. IOW I want the subprocess to take its input from the tty not the ruby superprocess. Ditto for output, How can I do this?
sush24 has joined #ruby-lang
<tsion>
MouseTheLuckyDog: does system("my-program") work for you?
<MouseTheLuckyDog>
tsion. No it doesn't.
<tsion>
why not?
<MouseTheLuckyDog>
When I run the ruby program I don't see output from "my-program" and "my-program" never actually gets any input.
<tsion>
assuming your program works like other interactive programs like irb, it seems like it should work
<tsion>
system("irb") for example, seems to work how you want on my machine
<MouseTheLuckyDog>
tsion. This is Kernel.system?
<tsion>
yes
<MouseTheLuckyDog>
tsion, you are right about irb, but for some reason the program I try doesn't.
<tsion>
hmm, i wonder what the difference is
<zachlatta>
How could I go about removing all strings from a hash that contain a given substring?
<MouseTheLuckyDog>
Hmm. It runs locally. The problem is that I am doing a ssh then a chroot, though those things shouldn;t affect it.
levifig has quit [Excess Flood]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
levifig has joined #ruby-lang
<erikh>
use Process.spawn
jsullivandigs has quit [Ping timeout: 264 seconds]
<MouseTheLuckyDog>
Ok now I feel stupid. I tried a bunch of things, there are only like 5 and I after I commented them out I tried the next thing. Somehow one of those early commands got uncommented So the script was hanging on the earlier call and I never got to the system call.
kennyvb has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
vlad_starkov has joined #ruby-lang
marr has quit [Ping timeout: 276 seconds]
<MouseTheLuckyDog>
Thansk for the help.
vlad_starkov has quit [Ping timeout: 245 seconds]
henrikhodne has joined #ruby-lang
krohrbaugh has joined #ruby-lang
ndrst has quit [Ping timeout: 264 seconds]
krohrbaugh has quit [Ping timeout: 252 seconds]
jxie has quit [Quit: leaving]
tylersmith has joined #ruby-lang
jxie has joined #ruby-lang
tylersmith has quit [Ping timeout: 255 seconds]
MouseTheLuckyDog has quit [Ping timeout: 268 seconds]
fosky has quit [Ping timeout: 276 seconds]
eval-in has quit [Remote host closed the connection]
Criztian has joined #ruby-lang
MouseTheLuckyDog has joined #ruby-lang
infecto has quit [Ping timeout: 252 seconds]
infecto has joined #ruby-lang
vlad_starkov has joined #ruby-lang
marr has joined #ruby-lang
poga has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 246 seconds]
migz has joined #ruby-lang
krohrbaugh has joined #ruby-lang
_dumfries has quit [Ping timeout: 260 seconds]
vmoravec has quit [Ping timeout: 260 seconds]
_dumfries has joined #ruby-lang
eval-in has joined #ruby-lang
djinni` has quit [Ping timeout: 255 seconds]
krohrbaugh has quit [Read error: Operation timed out]
s0ber_ has joined #ruby-lang
vmoravec_ has joined #ruby-lang
vmoravec_ has joined #ruby-lang
greenarrow has quit [Ping timeout: 255 seconds]
djinni` has joined #ruby-lang
greenarrow has joined #ruby-lang
17SACWMLN has joined #ruby-lang
17SACWMLN has quit [Remote host closed the connection]
s0ber has quit [Ping timeout: 260 seconds]
s0ber_ is now known as s0ber
nixterrimus has quit [Ping timeout: 276 seconds]
marr has quit [Ping timeout: 252 seconds]
marr has joined #ruby-lang
LineByLine has joined #ruby-lang
jovy88 has quit [Read error: Connection reset by peer]
mikestok has quit [Quit: Computer has gone to sleep.]
dettoaltrimenti has quit [Ping timeout: 256 seconds]
snk has quit [Quit: rebut]
breakingthings has joined #ruby-lang
nXqd has quit [Quit: leaving]
snk has joined #ruby-lang
wallerdev has joined #ruby-lang
sush24 has joined #ruby-lang
gregf has joined #ruby-lang
symm- has quit [Ping timeout: 272 seconds]
zzak_ is now known as zzak
<zzak>
hi
dhruvasagar has joined #ruby-lang
headius has joined #ruby-lang
poga has quit [Remote host closed the connection]
<apeiros>
hi zzak!
nofxx__ has joined #ruby-lang
srbaker has quit [Read error: Connection reset by peer]
My_Hearing has joined #ruby-lang
<zzak>
:D
brianpWins has quit [Quit: brianpWins]
Mon_Ouie has quit [Ping timeout: 256 seconds]
<yorickpeterse>
bah, getting chruby to play nicely with monit is a royal fucking PITA
<yorickpeterse>
especially if you're trying to run stuff that doesn't daemonize itself
<yorickpeterse>
or create PID files
dhruvasagar has quit [Ping timeout: 260 seconds]
retro|cz has joined #ruby-lang
Quatrerwin has quit [Remote host closed the connection]
<darix>
yorickpeterse: tried runit?
<darix>
especially with stuff that doesnt daemonize itself it plays nicely
<yorickpeterse>
yes, I've used it for two years
arubin has joined #ruby-lang
<yorickpeterse>
but it's super limited in what it can do
erpuds has joined #ruby-lang
<darix>
well it is good at keeping things running. and isnt that what you want atm?
jsullivandigs has joined #ruby-lang
<yorickpeterse>
fuckit, no chruby
dhruvasagar has joined #ruby-lang
<yorickpeterse>
saves myself a lot of trouble
<manveru>
rvm+runit ftw :)
<yorickpeterse>
don't need any different rubies any time soon anyway
<manveru>
for gemsets of course
<manveru>
locking down ruby version is just a nice benefit
<whitequark>
manveru: why do you want gemsets?
My_Hearing has quit [Ping timeout: 276 seconds]
<manveru>
because that's how i manage dependencies
<whitequark>
manveru: how is it better than bundler?
<whitequark>
(apart from "gemsets were earlier")
<manveru>
because env vars rock
<whitequark>
manveru: elaborate please
<manveru>
rvm sets $GEM_PATH and $GEM_HOME and that's pretty much it
<whitequark>
and this is better because?
<manveru>
no need to modify anything else
kmcfadden has joined #ruby-lang
<whitequark>
so you can run applications unmodified. hm.
<manveru>
no need to worry about bundler versions or bundle exec or bundle update or whatever
<whitequark>
well, you still need to worry about gem update
<manveru>
you can lock your versions by `rvm gemset export .gems` for example
<whitequark>
manveru: sure... that doesn't cover `bundle update`
<whitequark>
but I get the general idea, yeah.
<manveru>
anyway, obviously gemsets aren't popular anymore, but just saying it does everything bundler does except for the git dependencies stuff
<manveru>
and for that... well, i think it's a horrible idea anyway
<whitequark>
because?
<yorickpeterse>
it actually works really nice for internal Gems
<whitequark>
^
<manveru>
but if i predict right, bundler will be part of stdlib sometime soon, whether i like it or not :P
<whitequark>
also depending on unreleased critical fixes
<manveru>
or unreleased critical bugs :P
erpuds has quit [Quit: erpuds]
<manveru>
it's a double-edged sword
workmad3 has joined #ruby-lang
<whitequark>
manveru: well, it doesn't exactly differ with released versions, to be honest
<whitequark>
you need to examine the changelog in both cases. for git deps you need to do more work.
<manveru>
aye
<manveru>
there's no foolproof way
<manveru>
anyway, i use rvm already, and it serves me well, and it supplies me with gemsets that provide me with everything i need, so that doesn't make me eager to switch to chruby+bundler for example
<whitequark>
sure, I wasn't advocating bundler... was just curious
<manveru>
hehe
workmad3 has quit [Ping timeout: 264 seconds]
jg has joined #ruby-lang
Cosmos95 has quit [Quit: Cosmos95]
tylersmith has joined #ruby-lang
vbatts has joined #ruby-lang
retro|cz has quit [Ping timeout: 272 seconds]
cofin has quit [Quit: cofin]
erpuds has joined #ruby-lang
LineByLine has joined #ruby-lang
mytrile has joined #ruby-lang
infecto has quit [Read error: Operation timed out]
infecto has joined #ruby-lang
kmcfadden has left #ruby-lang ["Textual IRC Client: www.textualapp.com"]
<whitequark>
and I believe you misunderstand what the I combinator is
<whitequark>
[foo bar] is a list, right?
<judofyr>
whitequark: correct. I see your point, but I did steal `i` directly from Joy
<whitequark>
or, the thing which it pushes on stack is a list?
<whitequark>
ok
<whitequark>
judofyr: the syntax is really damn annoying for me
<whitequark>
so don't expect much useful feedback
<judofyr>
whitequark: I know. concat is really odd.
<whitequark>
well, not exactly the syntax. the stack
<whitequark>
yeah
<judofyr>
but there's just something magically simple about it
My_Hearing has joined #ruby-lang
<judofyr>
especially if you first learn Forht
<judofyr>
Forth*
jackhammer2022 has joined #ruby-lang
<whitequark>
it's good for IR and building *simple* interpreters. because it is, well, simple
<whitequark>
but it's a puzzle language (when used as a human-writable language): it forces you to rethink your problem and adapt it for the language
My_Hearing is now known as Mon_Ouie
<whitequark>
whereas (arguably) the opposite process should happen
<judofyr>
the beauty of Forth is that is so close the metal, yet you get a REPL and heavily factored code
<whitequark>
judofyr: no it isn't
<whitequark>
well... it maps well to a particular subset of CISC ISAs which isn't even very efficient
<judofyr>
whitequark: ehm, yes? every decent Forth will have an escape hatch for writing Assembly
scottschecter has quit [Quit: WeeChat 0.4.0]
<judofyr>
s/metal/assembly/
<whitequark>
judofyr: should I demonstrate you how to write inline assembly in ruby code?
krohrbaugh has quit [Ping timeout: 268 seconds]
jackhammer2022 has quit [Read error: Connection reset by peer]
<judofyr>
whitequark: and proper Forths are Forths you've implemented yourself for some specific archtecture
<whitequark>
there isn't anything particularly magic about forth itself. it is just a coincidence that it maps well to some of the modern ISAs
<judofyr>
coindidence is the best form of magic
<whitequark>
lambda calculus is simple as well, but our architectures suck at operating closures
<whitequark>
*with
<whitequark>
it can be compared, well, to the assembly itself
jackhammer2022 has joined #ruby-lang
<judofyr>
whitequark: I agree. I find Lisp and Forth to be very similar in nature (minimal), and yet so different (math vs asm)
<whitequark>
you can, if you want, write some 'beautiful' code, but in practice the compiler will easily kick your ass & it's far too impractical *especially* for perf-critical code
<whitequark>
why? because assembler and forth don't help you to manage complexity, they impose that task on you
<whitequark>
while remaining simple themselves
<whitequark>
worst kind of tradeoff :)
<whitequark>
a language which is hard for the machine to execute and hard for people to write
<judofyr>
whitequark: Forth shined on embedded for a few (good) reasons: (1) easy to implement; writing a good compiler takes way longer than implementing a Forth (2) uses little memory (3) gives you a REPL right away (4) doesn't impose any OS/filesystem abstractions.
<whitequark>
(3) only applies to a certain subset
<judofyr>
whitequark: and I do agree that today it doesn't matter anymore
<whitequark>
well. it's hard to define new words when most of your memory is ROM
<whitequark>
but this is not the point anyway
<whitequark>
judofyr: I've seen a good analysis of Charles Moore's GA144 and his IC authoring tools...
<judofyr>
whitequark: I've always wondered about the GA144. do you know if it's good?
<whitequark>
well. it shows exactly what one could expect: he has heavily factored his problem domain for it to be tractable with his language
<whitequark>
1) it takes time 2) you need to be an expert with the whole domain(s) you're going to touch
<whitequark>
in other words, for Moore it's probably good. us mere mortals should just run away.
<judofyr>
whitequark: it's fascinating as a way to write completely concurrent code. most concurrency architectures these days are "merely" based on running good, ol' sync code on different cores and synchronizing data between them (Actor, CSP). GA144 feels radically different.
<judofyr>
whitequark: but again: I'm not sure if that's a good or a bad thing
<whitequark>
judofyr: huh? both Actor and CSP aren't about "synchronizing data"
erpuds has joined #ruby-lang
blacktulip has joined #ruby-lang
<whitequark>
well, not CSP itself but its applications in practice
<whitequark>
I'm talking about
xcombelle has quit [Remote host closed the connection]
goyangi has left #ruby-lang [#ruby-lang]
kith has joined #ruby-lang
<judofyr>
whitequark: re: the first dadgum: god, that's horrible code. but it illustrates the thought of Forth very well: if something is ugly looking in Forth you (1) refactor code and/or (2) find a different angle (i.e. change the problem)
barttenbrinke has joined #ruby-lang
<whitequark>
judofyr: exactly
<whitequark>
and the (2) is the problem
<whitequark>
"minimalism" is about as valid a reason to change the problem as "flying spaghetti monster"
vlad_starkov has quit [Remote host closed the connection]
<judofyr>
whitequark: depends on what your goals are. Forth forces you to have clean code (because it turns into a mess otherwise), other languages lets you scale beyond your limitation and still give you an illusion of control.
<judofyr>
whitequark: but in these days where our computers are so powerful that waste doesn't really matter, Forth will just restrict you
mytrile has quit [Remote host closed the connection]
<whitequark>
judofyr: there are problems which can't be solved cleanly in forth
<whitequark>
well, "can't" is a strong word...
mytrile has joined #ruby-lang
<whitequark>
problems which are not worth solving in forth *because* it restricts you
<judofyr>
whitequark: those problems are (1) not being refactored enough or (2) isn't worth being solved :D
<judofyr>
(in Forth thinking)
<whitequark>
exactly
<whitequark>
I don't want to write in [language]. I want my shit to be solved.
dr_bob has joined #ruby-lang
<judofyr>
whitequark: I think we both agree. I just find it a very interesting line of thought that has produced fascinating constructs. (and most of those constructs have been very "practically" focused; Forth isn't much used in academics)
<judofyr>
whitequark: but to bring this back to Tvo: one of the thing I find really fascinating with Joy (and thus Tvo) is that it merges two very different languages: Lisp and Forth. and what you end up with is a really fascinating puzzle.
<rue>
“Even academics don’t use Forth”
<rue>
Is what I read
<whitequark>
^ LOL
<judofyr>
"Forth is too primitive for academics to care about it" is what I was aiming at
<whitequark>
wat
<judofyr>
whitequark: for instance, Joy is conceptually simpler than Lisp because it doesn't have closures. there's just some data structures (lists, numbers) and a stack. Lisp has this closure thingie that hides stuff.
<whitequark>
(cons environment . code) <-- here you are, a closure
<whitequark>
closures are an artifact of variables and lexical scoping
<judofyr>
whitequark: and that causes another cool thing: in Joy you treat code as data more often than in Lisp. where you in Lisp would use a closure, in Joy you would `cons` a variable onto a list.
<whitequark>
elaborate?
<judofyr>
2 sec
<whitequark>
and keep in mind that I'm one of those people who take a jigsaw puzzle and cut corners to assemble it faster. I *hate* puzzles. (Actually... yes but not paper ones :)
DomKM has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
<judofyr>
you can invoke a counter to get value, and a new counter
<judofyr>
when you invoke the new counter, you get the value +1
<judofyr>
in this example I use `cons` to return multiple values from counter
<whitequark>
it's hardly idiomatic lisp code
SqREL has joined #ruby-lang
<judofyr>
whitequark: well, the equivalent Joy code is easier, but you could rewrite the counter to return a cons of a value and a function and the same would apply
<judofyr>
the reason this code works at all (note: I haven't tested it) is because the lambda closes over the `num`
<judofyr>
whitequark: these counters are just a simplification of a lazy list. consider this just a special case of a lazy list that always increments.
<whitequark>
I suggest you take an example with closures from SICP and rewrite them in Joy ;)
<judofyr>
(while still following the lazy list interface)
<whitequark>
well, you've successfully proven that a lazy list which is idiomatic to Tvo isn't idiomatic to Lisp
<judofyr>
whitequark: the reason I did it this way is because the Joy code is simpler to grasp than other examples
<judofyr>
whitequark: the lazy lists in lazy.tvo does it similar to how you would do it Lisp, but I guess it didn't make more sense for you? :)
<judofyr>
whitequark: my point was this little snippet: http://hastebin.com/xaxaqumane.txt if you invoke it as `0 make-counter-from` we first end up with three elements on the stack (before the cons): `0 1 [make-counter-from]`. then when you cons it up you get `[0 1 make-counter-from]` on the stack.
<judofyr>
and the result is basically a closure: our code block contains the actual values that was closed ove.
<whitequark>
yeah...
<whitequark>
well, yes, I get your point
<judofyr>
whitequark: I realized that in Joy code-as-data is much more important than in Lisp. most idiomatic Lisp (*except* for macros) doesn't really care that code-is-also-data. closures means that code can't be represented as a list alone (but you also need its environment).
<whitequark>
yep
ozzloy has quit [Ping timeout: 276 seconds]
erpuds has quit [Quit: erpuds]
<whitequark>
however
<whitequark>
if you give up on lexical scoping in Lisp, you can do exactly the same thing
<whitequark>
dynamic scoping is basically the same stack trick
<judofyr>
I'm not sure if it's possible to accomplish the same thing without having the stack
<whitequark>
well, dynamic scoping is a kind of stack :)
<judofyr>
ah, nevermind
<whitequark>
hm...
<whitequark>
actually. I'm not sure if you actually need it
<judofyr>
whitequark: actually, you end up with macros if you do the same thing.
<whitequark>
judofyr: in a sense, code which creates closures in Tvo represents simple macros
<judofyr>
when a list is pushed to the stack, all _'s will be popped from the stack
<judofyr>
so `[foo] [uncons _ dip]` is the same as `[uncons [foo] dip]`
* whitequark
stuck an LTE modem out of his window
<whitequark>
I wonder what'll happen if it rails
<whitequark>
*rains
ozzloy has quit [Ping timeout: 256 seconds]
<whitequark>
judofyr: I don't like how you implemented it
<whitequark>
not metacircular enough
<ddfreyne>
judofyr: How does tvo compare to factor?
DomKM has joined #ruby-lang
<judofyr>
whitequark: it's not quite an immediate though. I don't want to execute when it parses, I want to execute it when it gets pushed to the stack.
<whitequark>
judofyr: executing stuff when it's pushed to stack is hardly idiomatic for forth
<whitequark>
kinda ruins the beauty
<judofyr>
whitequark: then you can use `cons` and build up lists manually (also: this is the bastard child of Lisp and Forth, so I'm not aiming for idiomatic Forth)
<whitequark>
judofyr: just add proper immediate words
<whitequark>
[ and immediate words are basically ` and ,
brianpWins has joined #ruby-lang
<judofyr>
ddfreyne: I haven't played that much with Factor, but the base is similar: concat-style with quotations from Joy and OOP support. Factor has a much more robust/static OOP system. you declare classes/interfaces. Tvo uses prototype-based OOP.
<judofyr>
ddfreyne: also, Factor is production-ready. I wrote Tvo this weekend.
<judofyr>
Factor is image-based
<judofyr>
Factor has a kick-ass compiler
<judofyr>
whitequark: but it's like semi-immediate: I don't want to run them while the word is defining.
marr has quit [Ping timeout: 252 seconds]
sush24 has quit [Quit: This computer has gone to sleep]