logs archiveIRC Archive / Freenode / #emacs / 2010 / July / 6 / 1
damd
off-topic: is there any way to run e.g. "mplayer *" but where "*" is "lazy" in the sense that it tries to expand further each time it has processed an item?
JordiGH
Eh?
damd: Exprain
damd
i'm unpacking lots of tv episodes here and i want to start watching all of them even though not all of them have been unpacked
technomancy
sure, just port your shell to Haskell.
damd
not even funny technomancy =(
JordiGH
damd: Script it?
damd
maybe i should write it in c++...
JordiGH
Maybe in assembler!
damd
"maybe i should write it in c++" is something some friends of mine would think
i'll have to fix me some cocoa milk though
maybe that's "chocolate milk"
         

karme
diff might be handy
scottj
damd: if you write a shell script please paste I'd be curious how to do that
JordiGH
(Action) would write Perl instead.
There's almost no reason to use bash instead of Perl.
And Perl doesn't have a whitespace thing.
Whitespace things do things like create XML build systems.
ggole
What on earth are you on about?
damd
lmao
JordiGH
bash's whitespace thing...
But actually, I was referring to Makefiles' whitespace thing.
e1f
i once found a site with scans of vintage comic books from the '50s and now i don't remember what it was
black and white 1950s scifi comics
anyone remember?
JordiGH
The origin story for Apache Ant is that someone got pissed off with tabs in Makefiles.
damd
e1f: superman
e1f
the site
damd
superman...
ggole
Oh, dear god. "Lisphp is a Lisp dialect written in PHP."
scottj
don't you think one benefit is familiarity? I haven't met anyone who runs perl as their shell, and I think there's something nice about being able to script the same way you interact with your shell
ggole
The name sounds like somebody is trying to pronounce 'Lisp' while simultaneously throwing up.
JordiGH
scottj: Not Perl as a shell, but for scripting. I hate bash scripting.
scottj: And wtf, I don't actually write shell programs in the bash REPL.
zc00gii
ggole: interesting
how do you pronounce it?
technomancy
(Action) uses eshell because elisp is more familiar than the horrors of bash-the-language
damd
LITHP
e1f
i once believed that bookmarks were pointless because you could always re-search for the things you searched for before
zc00gii
Isay "lisp pee asche pee"
         

scottj
JordiGH: I agree I wouldn't write a huge script in bash, but a small 5 liner like this, sure. even though ppl don't write the scripts in the repl, syntax and commands they use in the repl are directly transferable to the script
JordiGH
atche
zc00gii
what JordiGH said
imagine
JordiGH
What was the other thing besides s-expression in lisp that never caught on?
zc00gii
a bash program sorta written in C, each program it calls is a simple C program that calls a function with the program's arguments
technomancy
JordiGH: continuations?
zc00gii
like, ./strcmp "hi" "foo"
err
./strcmp hi foo
or something xD
ggole
JordiGH: M-expressions.
Or do you mean, never caught on except outside of lisp? Macros?
scottj
cadadaadddr
JordiGH
I think I meant M-expressions
Ah, the original intent was to separate functions from data.
But that lack of separation is precisely why people have powerful erections about lisp, right?
ggole
Not entirely.
Part of it is that lisp code is just data which can be munged with regular lisp functions and then used as code again
But there's other lispy stuff which the rest of the world also rejected, like image-based development
JordiGH
Image-based?
scottj
think smalltalk
JordiGH
I heard smalltalk is a pure OOP language that inspired C++.
ggole
C++ didn't really take anything from smalltalk.
damd
i heard smalltalk inspired c++ which inspired objective-c which borrowed inspiration from smalltalk
JordiGH
Bjarne mentions smalltalk in his books.
tensorpudding
Objective-C is definitely inspired by Smalltalk.
technomancy
Smalltalk inspired C++ in the same way that cheese inspired cheese-wiz.
ggole
Yeah, he's good with the name dropping. If you go and look at Smalltalk and look at C++, though, there's little similarity.
JordiGH
Why doesn't anyone use smalltalk anymore?
damd
because of its gui
scottj
does objc use blocks?
damd
objective c uses message passing
wgreenhouse
JordiGH: image-based as in disk image. smalltalk offers lazily preserving program state by just making an updated image of your smalltalk environment
technomancy
JordiGH: smalltalk came from the days before Unix won. it tries really hard to pretend the host OS doesn't really exist.
ggole
Smalltalk, and to a lesser extent lisp, wants to suck you into its own little world
wgreenhouse
JordiGH: the paradigm is that you would have these self-contained images and the host OS would do almost nothing
ggole
Languages that fitted into Unix proved to be much more popular than the persistent imagey ones.
scottj
JordiGH: smalltalk didn't have affordable implementations until recently
JordiGH
Affordable?
jordanb
rudybot: quote
rudybot
Let's watch our points.
JordiGH
So by charging for it, nobody used it, and now you can't charge for it?
ggole
Dennis Ritchie got it right, really. For all that people bi**h about C, it works magnificently with Unix.
jordanb
smalltalk was owned by disney
you had to find a young child
wgreenhouse
Squeak, which is one of the modern FLOSS smalltalk implementations, was the basis for the OLPC Sugar desktop environment
jordanb
's imagination
wgreenhouse
so there are still a few smalltalk projects around
jordanb
And drain it out of them so the mouse that lives in the night may feast on it.
How do you know Sugar is doomed? They went with smalltalk!
wgreenhouse
:)
jordanb
They should have just said "fu*k it, we're MIT nerds"
And went with haskell
JordiGH
s/went/go
/
ggole
JordiGH: have you read worse is better?
wgreenhouse
they are such MIT nerds it's not even funny. I think "media lab" may now be synonymous with "impractical projects lab"
parolang
I thought Sugar was written mainly in Python?
JordiGH
For all y'all's helpful explanations, I still don't understand what "image-based" means.
jordanb
it's a 'media lab' because they k now how to manipulate the media to get good press fo dumb ideas
ggole
JordiGH: basically code lives in a persistent image which you can update on the fly.
damd
how do you program something real in C?
technomancy
JordiGH: imagine if instead of writing to the file system, Emacs wrote to a built-in self-contained FS, but all your changes to your functions and vars persisted across runs.
wgreenhouse
JordiGH: the whole environment, including code and data, or as much as possible, lives in a disk image that is run by the smalltalk runtime. there is no volatile state
ggole
Rather than recompiling, you just update a function or two.
damd: carefully
jordanb
damd: First you have to be a flaming as****e. All good C programmers are flaming as****es.
damd
people keep asking me "well how do you write real programs in haskell?" i want to know the same about C.
jordanb
oh
JordiGH
damd: I think the GNU Scientific Library is an example of good C.
jordanb
Obviously, unlike Haskell, there are a few examples here and there of successful C programs.
JordiGH: :P
JordiGH
damd: They do stuff like hack inheritance, macros, and namespaces in C.
Oh, I get it.
That sounds weird. Image-based programming, I mean.
damd
say i want to write a C XML parser... i'm sure there are lots of them lying around, but where would i start?
scottj
JordiGH: vmware sounds weird
damd
how would i represent an XML node? *would* i represent an XML node?
wgreenhouse
JordiGH: it's also a very old-school way of envisioning how to platform-independent software development
JordiGH
damd: No, there are probably zero to none.
damd
JordiGH: are you serious?
JordiGH
damd: Writing an XML parser in C is bound to be painful.
jordanb
damd: struct?
JordiGH
damd: How many kernel modules are written in Haskell?
damd
jordanb: and so the tag name would be a char[]?
jordanb
It'd be a char *tag_name;
member of struct
JordiGH
damd: you can represent many things in C with structs and typedefs in pointers, but whether you would want to do it, that's another story.
jordanb
man, my cool swing channel has switched to inaccessible jaz
jazz
damd
so what is the ultimate programming language today, boys? i'm bound to say python because it's awesome at virtually anything.
jordanb
Ada
JordiGH
damd: How many kernel modules are written in Python?
technomancy
it's Io, guys
damd
JordiGH: how many XML parsers are written in C?
JordiGH
damd: Of course. Different tool for a different job.
damd
JordiGH: do you often write kernel modules?
scottj
damd: how many multithreaded apps in python?
ggole
Quite a few, I imagine
JordiGH
Do you often write XML parsers?
damd
JordiGH: i do
jordanb
writing one-line xml parsers is one of the thing haskellers do
JordiGH
Jesus, how many times have you written an XML parser?
:-/
damd
one for every language i've learned
jordanb
It's like a di*k size contest.
JordiGH
damd: http://3.bp.blogspot.com/_ESfodwZmuuI/S7TxhJtIkgI/AAAAAAAAA4Q/V5AdtvmjC-w/s320/xkcd_well_2.png
jordanb: <3
ggole
damd: so do you want to understand C, or bi**h about it?
wgreenhouse
parolang: sorry, I was mistaken--I was thinking of etoys, which is one of the apps on OLPC and one of the inspirations for sugar. that environment was originally written in smalltalk, but both are python today
jordanb
Is that randall munroe actually a computer programmer?
JordiGH
damd: You can probably do it in C, but you have to remember that C is a byte-pushing language. It was meant to be portable assembler.
damd
ggole: i want to understand how to think when writing C. i'm used to higher-order functions, python dictionaries, haskell data types and type classes, C# classes, ...
JordiGH
jordanb: inorite
jordanb
Didn't he work for six months at NASA on "robotics" before getting fired?
JordiGH
damd: You think in bytes in C.
damd: You think, "I'm about to write a segfault?"
scottj
are python dictionaries any different than dictionaries in every other language?
damd
scottj: not really, it's just that they are quite convenient to use when writing python
jordanb
damd: You should read Knuth, he goes past C and shows how to do all that in assembly.
technomancy
are there other languages that call them dictionaries?
damd
you don't have to do "new Dictionary<string, object>()" for instance
JordiGH
technomancy: they're maps in C++. :-/
scottj
technomancy: smalltalk
JordiGH
And hashes in Perl.
ggole
damd: you want C to solve your problems for you. C doesn't really do that. It just represents the machine.
jordanb
People don't use hashes anymore.
JordiGH
damd: You realise that C doesn't even have native hashes or dictionaries and arguably not even strings?
damd
JordiGH: that's why i'm asking about C :)
JordiGH
damd: You think in bytes and you tread carefully making sure you're not about to segfault.
And you think about memory locations and their contents.
damd
so how about this malloc thing? it allocates memory, correct?
JordiGH
That's the theory.
ggole
damd: go and read K&R.
damd
are you implying that in practice it's a different story?
JordiGH
damd: Well, what if there isn't enough memory?
damd
ggole: let's discuss C here instead
JordiGH: yeah, what then?
JordiGH
damd: What if there is but you've already incurred UB before you malloc? What is it gonna allocate, then?
ggole
damd: if you don't know what malloc does there's nothing to discuss.
JordiGH: also, malloc might "misbehave" on zero length allocations.
damd
ggole: are you not okay with me discussing C with JordiGH?
jordanb
rudybot: behave
rudybot
jordanb: Wes-mac: [->] AquamacsEmacs -- [0] a fork of Carbon Emacs broken to behave less like Emacs and more like OS X <http://emacswiki.org/wiki/AquamacsEmacs>
JordiGH
damd: The point is that in C you have to be extremely defensive against the language.
jordanb
C: User Hostile
That's why C programmers are all so bitter.
JordiGH
Not user hostile. Developer hostile.
jordanb
The developer is a user.
karme
portable assembler is a good description imho
JordiGH
damd: This is C: http://qdb.us/79369
damd
JordiGH: do you know of a website that has good exercises for some average computer joe that wants to understand C a bit more?
karme
the nice thing about c is: everybody knows it sucks
jordanb
karme: Swarmy twits like Linus Torvalds thinks its AWESOME!
JordiGH
damd: I think ##c knows of a good FAQ but that's assuming you already know C and you just want to avoid a few gotchas.
jordanb
Yeah eveone in ##c is an as****e.
ggole
Not so. Some of them are idlers.
jordanb
damd: Read knuth. ^_^ then you'll be able to write in assembly and C will seem easy.
« prev 1 2 3 4 5 6 7 8 9 10 next »